Make Broken Blocks Display Associated FluidState (#8129)

Fixes #7253 for 1.16.x
This commit is contained in:
ChampionAsh5357 authored and GitHub committed 2021-11-20 14:42:38 +01:00
1 parent 0ecc6c6359
commit 4610784443
1 file changed
+1 -21
@@ -592,7 +592,7 @@ public class ForgeHooks
// Tell client the block is gone immediately then process events
if (world.getBlockEntity(pos) == null)
{
entityPlayer.connection.send(new SChangeBlockPacket(DUMMY_WORLD, pos));
entityPlayer.connection.send(new SChangeBlockPacket(pos, world.getFluidState(pos).createLegacyBlock()));
}
// Post the block break event
@@ -1148,26 +1148,6 @@ public class ForgeHooks
}
}
private static final DummyBlockReader DUMMY_WORLD = new DummyBlockReader();
private static class DummyBlockReader implements IBlockReader {
@Override
public TileEntity getBlockEntity(BlockPos pos) {
return null;
}
@Override
public BlockState getBlockState(BlockPos pos) {
return Blocks.AIR.defaultBlockState();
}
@Override
public FluidState getFluidState(BlockPos pos) {
return Fluids.EMPTY.defaultFluidState();
}
}
public static int onNoteChange(World world, BlockPos pos, BlockState state, int old, int _new) {
NoteBlockEvent.Change event = new NoteBlockEvent.Change(world, pos, state, old, _new);
if (MinecraftForge.EVENT_BUS.post(event))