Fix cast check (#4813)

This commit is contained in:
Josh Roy 2020-11-27 13:07:41 -05:00
parent 8996aa88cd
commit 603d4bb5a6

View file

@ -32,8 +32,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
set.add(blockposition);
+ // Paper start - prevent headless pistons from forming
+ if (!com.destroystokyo.paper.PaperConfig.allowHeadlessPistons && iblockdata.getBlock() == Blocks.MOVING_PISTON) {
+ TileEntityPiston extension = (TileEntityPiston)this.world.getTileEntity(blockposition);
+ if (extension.isHead()) {
+ TileEntity extension = this.world.getTileEntity(blockposition);
+ if (extension instanceof TileEntityPiston && ((TileEntityPiston) extension).isHead()) {
+ EnumDirection direction = iblockdata.get(BlockPistonExtension.FACING);
+ set.add(blockposition.shift(direction.opposite()));
+ }