I ran into an odd bug randomly which I am pretty sure is just due to accidentally passing the wrong parameter to a method. Using forge names, the method isSmokingBlockAt in CampfireBlock seems to be passing the wrong position to getCollisionShape. With forge mappings the method looks like this:
public static boolean isSmokingBlockAt(World world, BlockPos pos) {
for(int i = 1; i <= 5; ++i) {
BlockPos blockpos = pos.down(i);
BlockState blockstate = world.getBlockState(blockpos);
if (isLit(blockstate)) {
return true;
}
boolean flag = VoxelShapes.compare(SMOKING_SHAPE, blockstate.getCollisionShape(world, pos, ISelectionContext.dummy()), IBooleanFunction.AND);
if (flag) {
BlockState blockstate1 = world.getBlockState(blockpos.down());
return isLit(blockstate1);
}
}
return false;
}
and passes pos to blockstate#getCollisionShape. The issue is that BlockState is gotten from the world at blockpos and not pos, and likely doesn't even exist in the world at pos.
Confirmed, although this seems to have no actual in-game consequence, since the only relevant block I could find that uses the passed-in
blockPos
to determine its collision box is bamboo, which intentionally ignores the Y value, the only value with a discrepancy.