Wrong position passed to getCollisionShape from CampfireBlock#isSmokingBlockAt
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.
2020-10-01, 11:37 PM
2024-05-27, 07:24 PM
8
4
-