diff options
Diffstat (limited to 'patch-remap/mache-spigotflower/net/minecraft/world/level/block/BeehiveBlock.java.patch')
-rw-r--r-- | patch-remap/mache-spigotflower/net/minecraft/world/level/block/BeehiveBlock.java.patch | 447 |
1 files changed, 447 insertions, 0 deletions
diff --git a/patch-remap/mache-spigotflower/net/minecraft/world/level/block/BeehiveBlock.java.patch b/patch-remap/mache-spigotflower/net/minecraft/world/level/block/BeehiveBlock.java.patch new file mode 100644 index 0000000000..e81fd11f29 --- /dev/null +++ b/patch-remap/mache-spigotflower/net/minecraft/world/level/block/BeehiveBlock.java.patch @@ -0,0 +1,447 @@ +--- a/net/minecraft/world/level/block/BeehiveBlock.java ++++ b/net/minecraft/world/level/block/BeehiveBlock.java +@@ -17,7 +17,7 @@ + import net.minecraft.tags.BlockTags; + import net.minecraft.util.Mth; + import net.minecraft.util.RandomSource; +-import net.minecraft.world.InteractionHand; ++import net.minecraft.world.EnumHand; + import net.minecraft.world.InteractionResult; + import net.minecraft.world.entity.Entity; + import net.minecraft.world.entity.animal.Bee; +@@ -43,7 +43,7 @@ + import net.minecraft.world.level.block.entity.BlockEntityTicker; + import net.minecraft.world.level.block.entity.BlockEntityType; + import net.minecraft.world.level.block.state.BlockBehaviour; +-import net.minecraft.world.level.block.state.BlockState; ++import net.minecraft.world.level.block.state.IBlockData; + import net.minecraft.world.level.block.state.StateDefinition; + import net.minecraft.world.level.block.state.properties.BlockStateProperties; + import net.minecraft.world.level.block.state.properties.DirectionProperty; +@@ -64,52 +64,48 @@ + private static final int SHEARED_HONEYCOMB_COUNT = 3; + + @Override +- @Override + public MapCodec<BeehiveBlock> codec() { + return BeehiveBlock.CODEC; + } + +- public BeehiveBlock(BlockBehaviour.Properties blockbehaviour_properties) { +- super(blockbehaviour_properties); +- this.registerDefaultState((BlockState) ((BlockState) ((BlockState) this.stateDefinition.any()).setValue(BeehiveBlock.HONEY_LEVEL, 0)).setValue(BeehiveBlock.FACING, Direction.NORTH)); ++ public BeehiveBlock(BlockBehaviour.Properties properties) { ++ super(properties); ++ this.registerDefaultState((IBlockData) ((IBlockData) ((IBlockData) this.stateDefinition.any()).setValue(BeehiveBlock.HONEY_LEVEL, 0)).setValue(BeehiveBlock.FACING, Direction.NORTH)); + } + + @Override +- @Override +- public boolean hasAnalogOutputSignal(BlockState blockstate) { ++ public boolean hasAnalogOutputSignal(IBlockData state) { + return true; + } + + @Override +- @Override +- public int getAnalogOutputSignal(BlockState blockstate, Level level, BlockPos blockpos) { +- return (Integer) blockstate.getValue(BeehiveBlock.HONEY_LEVEL); ++ public int getAnalogOutputSignal(IBlockData blockState, Level level, BlockPos pos) { ++ return (Integer) blockState.getValue(BeehiveBlock.HONEY_LEVEL); + } + + @Override +- @Override +- public void playerDestroy(Level level, Player player, BlockPos blockpos, BlockState blockstate, @Nullable BlockEntity blockentity, ItemStack itemstack) { +- super.playerDestroy(level, player, blockpos, blockstate, blockentity, itemstack); +- if (!level.isClientSide && blockentity instanceof BeehiveBlockEntity) { +- BeehiveBlockEntity beehiveblockentity = (BeehiveBlockEntity) blockentity; ++ public void playerDestroy(Level level, Player player, BlockPos pos, IBlockData state, @Nullable BlockEntity te, ItemStack stack) { ++ super.playerDestroy(level, player, pos, state, te, stack); ++ if (!level.isClientSide && te instanceof BeehiveBlockEntity) { ++ BeehiveBlockEntity tileentitybeehive = (BeehiveBlockEntity) te; + +- if (EnchantmentHelper.getItemEnchantmentLevel(Enchantments.SILK_TOUCH, itemstack) == 0) { +- beehiveblockentity.emptyAllLivingFromHive(player, blockstate, BeehiveBlockEntity.BeeReleaseStatus.EMERGENCY); +- level.updateNeighbourForOutputSignal(blockpos, this); +- this.angerNearbyBees(level, blockpos); ++ if (EnchantmentHelper.getItemEnchantmentLevel(Enchantments.SILK_TOUCH, stack) == 0) { ++ tileentitybeehive.emptyAllLivingFromHive(player, state, BeehiveBlockEntity.ReleaseStatus.EMERGENCY); ++ level.updateNeighbourForOutputSignal(pos, this); ++ this.angerNearbyBees(level, pos); + } + +- CriteriaTriggers.BEE_NEST_DESTROYED.trigger((ServerPlayer) player, blockstate, itemstack, beehiveblockentity.getOccupantCount()); ++ CriteriaTriggers.BEE_NEST_DESTROYED.trigger((ServerPlayer) player, state, stack, tileentitybeehive.getOccupantCount()); + } + + } + +- private void angerNearbyBees(Level level, BlockPos blockpos) { +- AABB aabb = (new AABB(blockpos)).inflate(8.0D, 6.0D, 8.0D); +- List<Bee> list = level.getEntitiesOfClass(Bee.class, aabb); ++ private void angerNearbyBees(Level level, BlockPos pos) { ++ AABB axisalignedbb = (new AABB(pos)).inflate(8.0D, 6.0D, 8.0D); ++ List<Bee> list = level.getEntitiesOfClass(Bee.class, axisalignedbb); + + if (!list.isEmpty()) { +- List<Player> list1 = level.getEntitiesOfClass(Player.class, aabb); ++ List<Player> list1 = level.getEntitiesOfClass(Player.class, axisalignedbb); + + if (list1.isEmpty()) { + return; +@@ -118,27 +114,26 @@ + Iterator iterator = list.iterator(); + + while (iterator.hasNext()) { +- Bee bee = (Bee) iterator.next(); ++ Bee entitybee = (Bee) iterator.next(); + +- if (bee.getTarget() == null) { +- Player player = (Player) Util.getRandom(list1, level.random); ++ if (entitybee.getTarget() == null) { ++ Player entityhuman = (Player) Util.getRandom(list1, level.random); + +- bee.setTarget(player); ++ entitybee.setTarget(entityhuman, org.bukkit.event.entity.EntityTargetEvent.TargetReason.CLOSEST_PLAYER, true); // CraftBukkit + } + } + } + + } + +- public static void dropHoneycomb(Level level, BlockPos blockpos) { +- popResource(level, blockpos, new ItemStack(Items.HONEYCOMB, 3)); ++ public static void dropHoneycomb(Level level, BlockPos pos) { ++ popResource(level, pos, new ItemStack(Items.HONEYCOMB, 3)); + } + + @Override +- @Override +- public InteractionResult use(BlockState blockstate, Level level, BlockPos blockpos, Player player, InteractionHand interactionhand, BlockHitResult blockhitresult) { +- ItemStack itemstack = player.getItemInHand(interactionhand); +- int i = (Integer) blockstate.getValue(BeehiveBlock.HONEY_LEVEL); ++ public InteractionResult use(IBlockData state, Level level, BlockPos pos, Player player, EnumHand hand, BlockHitResult hit) { ++ ItemStack itemstack = player.getItemInHand(hand); ++ int i = (Integer) state.getValue(BeehiveBlock.HONEY_LEVEL); + boolean flag = false; + + if (i >= 5) { +@@ -146,23 +141,23 @@ + + if (itemstack.is(Items.SHEARS)) { + level.playSound(player, player.getX(), player.getY(), player.getZ(), SoundEvents.BEEHIVE_SHEAR, SoundSource.BLOCKS, 1.0F, 1.0F); +- dropHoneycomb(level, blockpos); +- itemstack.hurtAndBreak(1, player, (player1) -> { +- player1.broadcastBreakEvent(interactionhand); ++ dropHoneycomb(level, pos); ++ itemstack.hurtAndBreak(1, player, (entityhuman1) -> { ++ entityhuman1.broadcastBreakEvent(hand); + }); + flag = true; +- level.gameEvent((Entity) player, GameEvent.SHEAR, blockpos); ++ level.gameEvent((Entity) player, GameEvent.SHEAR, pos); + } else if (itemstack.is(Items.GLASS_BOTTLE)) { + itemstack.shrink(1); + level.playSound(player, player.getX(), player.getY(), player.getZ(), SoundEvents.BOTTLE_FILL, SoundSource.BLOCKS, 1.0F, 1.0F); + if (itemstack.isEmpty()) { +- player.setItemInHand(interactionhand, new ItemStack(Items.HONEY_BOTTLE)); ++ player.setItemInHand(hand, new ItemStack(Items.HONEY_BOTTLE)); + } else if (!player.getInventory().add(new ItemStack(Items.HONEY_BOTTLE))) { + player.drop(new ItemStack(Items.HONEY_BOTTLE), false); + } + + flag = true; +- level.gameEvent((Entity) player, GameEvent.FLUID_PICKUP, blockpos); ++ level.gameEvent((Entity) player, GameEvent.FLUID_PICKUP, pos); + } + + if (!level.isClientSide() && flag) { +@@ -171,79 +166,78 @@ + } + + if (flag) { +- if (!CampfireBlock.isSmokeyPos(level, blockpos)) { +- if (this.hiveContainsBees(level, blockpos)) { +- this.angerNearbyBees(level, blockpos); ++ if (!CampfireBlock.isSmokeyPos(level, pos)) { ++ if (this.hiveContainsBees(level, pos)) { ++ this.angerNearbyBees(level, pos); + } + +- this.releaseBeesAndResetHoneyLevel(level, blockstate, blockpos, player, BeehiveBlockEntity.BeeReleaseStatus.EMERGENCY); ++ this.releaseBeesAndResetHoneyLevel(level, state, pos, player, BeehiveBlockEntity.ReleaseStatus.EMERGENCY); + } else { +- this.resetHoneyLevel(level, blockstate, blockpos); ++ this.resetHoneyLevel(level, state, pos); + } + + return InteractionResult.sidedSuccess(level.isClientSide); + } else { +- return super.use(blockstate, level, blockpos, player, interactionhand, blockhitresult); ++ return super.use(state, level, pos, player, hand, hit); + } + } + +- private boolean hiveContainsBees(Level level, BlockPos blockpos) { +- BlockEntity blockentity = level.getBlockEntity(blockpos); ++ private boolean hiveContainsBees(Level level, BlockPos pos) { ++ BlockEntity tileentity = level.getBlockEntity(pos); + +- if (blockentity instanceof BeehiveBlockEntity) { +- BeehiveBlockEntity beehiveblockentity = (BeehiveBlockEntity) blockentity; ++ if (tileentity instanceof BeehiveBlockEntity) { ++ BeehiveBlockEntity tileentitybeehive = (BeehiveBlockEntity) tileentity; + +- return !beehiveblockentity.isEmpty(); ++ return !tileentitybeehive.isEmpty(); + } else { + return false; + } + } + +- public void releaseBeesAndResetHoneyLevel(Level level, BlockState blockstate, BlockPos blockpos, @Nullable Player player, BeehiveBlockEntity.BeeReleaseStatus beehiveblockentity_beereleasestatus) { +- this.resetHoneyLevel(level, blockstate, blockpos); +- BlockEntity blockentity = level.getBlockEntity(blockpos); ++ public void releaseBeesAndResetHoneyLevel(Level level, IBlockData state, BlockPos pos, @Nullable Player player, BeehiveBlockEntity.ReleaseStatus beeReleaseStatus) { ++ this.resetHoneyLevel(level, state, pos); ++ BlockEntity tileentity = level.getBlockEntity(pos); + +- if (blockentity instanceof BeehiveBlockEntity) { +- BeehiveBlockEntity beehiveblockentity = (BeehiveBlockEntity) blockentity; ++ if (tileentity instanceof BeehiveBlockEntity) { ++ BeehiveBlockEntity tileentitybeehive = (BeehiveBlockEntity) tileentity; + +- beehiveblockentity.emptyAllLivingFromHive(player, blockstate, beehiveblockentity_beereleasestatus); ++ tileentitybeehive.emptyAllLivingFromHive(player, state, beeReleaseStatus); + } + + } + +- public void resetHoneyLevel(Level level, BlockState blockstate, BlockPos blockpos) { +- level.setBlock(blockpos, (BlockState) blockstate.setValue(BeehiveBlock.HONEY_LEVEL, 0), 3); ++ public void resetHoneyLevel(Level level, IBlockData state, BlockPos pos) { ++ level.setBlock(pos, (IBlockData) state.setValue(BeehiveBlock.HONEY_LEVEL, 0), 3); + } + + @Override +- @Override +- public void animateTick(BlockState blockstate, Level level, BlockPos blockpos, RandomSource randomsource) { +- if ((Integer) blockstate.getValue(BeehiveBlock.HONEY_LEVEL) >= 5) { +- for (int i = 0; i < randomsource.nextInt(1) + 1; ++i) { +- this.trySpawnDripParticles(level, blockpos, blockstate); ++ public void animateTick(IBlockData state, Level level, BlockPos pos, RandomSource random) { ++ if ((Integer) state.getValue(BeehiveBlock.HONEY_LEVEL) >= 5) { ++ for (int i = 0; i < random.nextInt(1) + 1; ++i) { ++ this.trySpawnDripParticles(level, pos, state); + } + } + + } + +- private void trySpawnDripParticles(Level level, BlockPos blockpos, BlockState blockstate) { +- if (blockstate.getFluidState().isEmpty() && level.random.nextFloat() >= 0.3F) { +- VoxelShape voxelshape = blockstate.getCollisionShape(level, blockpos); ++ private void trySpawnDripParticles(Level level, BlockPos pos, IBlockData state) { ++ if (state.getFluidState().isEmpty() && level.random.nextFloat() >= 0.3F) { ++ VoxelShape voxelshape = state.getCollisionShape(level, pos); + double d0 = voxelshape.max(Direction.Axis.Y); + +- if (d0 >= 1.0D && !blockstate.is(BlockTags.IMPERMEABLE)) { ++ if (d0 >= 1.0D && !state.is(BlockTags.IMPERMEABLE)) { + double d1 = voxelshape.min(Direction.Axis.Y); + + if (d1 > 0.0D) { +- this.spawnParticle(level, blockpos, voxelshape, (double) blockpos.getY() + d1 - 0.05D); ++ this.spawnParticle(level, pos, voxelshape, (double) pos.getY() + d1 - 0.05D); + } else { +- BlockPos blockpos1 = blockpos.below(); +- BlockState blockstate1 = level.getBlockState(blockpos1); +- VoxelShape voxelshape1 = blockstate1.getCollisionShape(level, blockpos1); ++ BlockPos blockposition1 = pos.below(); ++ IBlockData iblockdata1 = level.getBlockState(blockposition1); ++ VoxelShape voxelshape1 = iblockdata1.getCollisionShape(level, blockposition1); + double d2 = voxelshape1.max(Direction.Axis.Y); + +- if ((d2 < 1.0D || !blockstate1.isCollisionShapeFullBlock(level, blockpos1)) && blockstate1.getFluidState().isEmpty()) { +- this.spawnParticle(level, blockpos, voxelshape, (double) blockpos.getY() - 0.05D); ++ if ((d2 < 1.0D || !iblockdata1.isCollisionShapeFullBlock(level, blockposition1)) && iblockdata1.getFluidState().isEmpty()) { ++ this.spawnParticle(level, pos, voxelshape, (double) pos.getY() - 0.05D); + } + } + } +@@ -251,124 +245,114 @@ + } + } + +- private void spawnParticle(Level level, BlockPos blockpos, VoxelShape voxelshape, double d0) { +- this.spawnFluidParticle(level, (double) blockpos.getX() + voxelshape.min(Direction.Axis.X), (double) blockpos.getX() + voxelshape.max(Direction.Axis.X), (double) blockpos.getZ() + voxelshape.min(Direction.Axis.Z), (double) blockpos.getZ() + voxelshape.max(Direction.Axis.Z), d0); ++ private void spawnParticle(Level level, BlockPos pos, VoxelShape shape, double y) { ++ this.spawnFluidParticle(level, (double) pos.getX() + shape.min(Direction.Axis.X), (double) pos.getX() + shape.max(Direction.Axis.X), (double) pos.getZ() + shape.min(Direction.Axis.Z), (double) pos.getZ() + shape.max(Direction.Axis.Z), y); + } + +- private void spawnFluidParticle(Level level, double d0, double d1, double d2, double d3, double d4) { +- level.addParticle(ParticleTypes.DRIPPING_HONEY, Mth.lerp(level.random.nextDouble(), d0, d1), d4, Mth.lerp(level.random.nextDouble(), d2, d3), 0.0D, 0.0D, 0.0D); ++ private void spawnFluidParticle(Level particleData, double x1, double d1, double x2, double d3, double z1) { ++ particleData.addParticle(ParticleTypes.DRIPPING_HONEY, Mth.lerp(particleData.random.nextDouble(), x1, d1), z1, Mth.lerp(particleData.random.nextDouble(), x2, d3), 0.0D, 0.0D, 0.0D); + } + + @Override +- @Override +- public BlockState getStateForPlacement(BlockPlaceContext blockplacecontext) { +- return (BlockState) this.defaultBlockState().setValue(BeehiveBlock.FACING, blockplacecontext.getHorizontalDirection().getOpposite()); ++ public IBlockData getStateForPlacement(BlockPlaceContext context) { ++ return (IBlockData) this.defaultBlockState().setValue(BeehiveBlock.FACING, context.getHorizontalDirection().getOpposite()); + } + + @Override +- @Override +- protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> statedefinition_builder) { +- statedefinition_builder.add(BeehiveBlock.HONEY_LEVEL, BeehiveBlock.FACING); ++ protected void createBlockStateDefinition(StateDefinition.Builder<Block, IBlockData> builder) { ++ builder.add(BeehiveBlock.HONEY_LEVEL, BeehiveBlock.FACING); + } + + @Override +- @Override +- public RenderShape getRenderShape(BlockState blockstate) { +- return RenderShape.MODEL; ++ public EnumRenderType getRenderShape(IBlockData state) { ++ return EnumRenderType.MODEL; + } + + @Nullable + @Override +- @Override +- public BlockEntity newBlockEntity(BlockPos blockpos, BlockState blockstate) { +- return new BeehiveBlockEntity(blockpos, blockstate); ++ public BlockEntity newBlockEntity(BlockPos pos, IBlockData state) { ++ return new BeehiveBlockEntity(pos, state); + } + + @Nullable + @Override +- @Override +- public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level level, BlockState blockstate, BlockEntityType<T> blockentitytype) { +- return level.isClientSide ? null : createTickerHelper(blockentitytype, BlockEntityType.BEEHIVE, BeehiveBlockEntity::serverTick); ++ public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level level, IBlockData state, BlockEntityType<T> blockEntityType) { ++ return level.isClientSide ? null : createTickerHelper(blockEntityType, BlockEntityType.BEEHIVE, BeehiveBlockEntity::serverTick); + } + + @Override +- @Override +- public BlockState playerWillDestroy(Level level, BlockPos blockpos, BlockState blockstate, Player player) { +- if (!level.isClientSide && player.isCreative() && level.getGameRules().getBoolean(GameRules.RULE_DOBLOCKDROPS)) { +- BlockEntity blockentity = level.getBlockEntity(blockpos); ++ public IBlockData playerWillDestroy(Level world, BlockPos blockposition, IBlockData iblockdata, Player entityhuman) { ++ if (!world.isClientSide && entityhuman.isCreative() && world.getGameRules().getBoolean(GameRules.RULE_DOBLOCKDROPS)) { ++ BlockEntity tileentity = world.getBlockEntity(blockposition); + +- if (blockentity instanceof BeehiveBlockEntity) { +- BeehiveBlockEntity beehiveblockentity = (BeehiveBlockEntity) blockentity; ++ if (tileentity instanceof BeehiveBlockEntity) { ++ BeehiveBlockEntity tileentitybeehive = (BeehiveBlockEntity) tileentity; + ItemStack itemstack = new ItemStack(this); +- int i = (Integer) blockstate.getValue(BeehiveBlock.HONEY_LEVEL); +- boolean flag = !beehiveblockentity.isEmpty(); ++ int i = (Integer) iblockdata.getValue(BeehiveBlock.HONEY_LEVEL); ++ boolean flag = !tileentitybeehive.isEmpty(); + + if (flag || i > 0) { +- CompoundTag compoundtag; ++ CompoundTag nbttagcompound; + + if (flag) { +- compoundtag = new CompoundTag(); +- compoundtag.put("Bees", beehiveblockentity.writeBees()); +- BlockItem.setBlockEntityData(itemstack, BlockEntityType.BEEHIVE, compoundtag); ++ nbttagcompound = new CompoundTag(); ++ nbttagcompound.put("Bees", tileentitybeehive.writeBees()); ++ BlockItem.setBlockEntityData(itemstack, BlockEntityType.BEEHIVE, nbttagcompound); + } + +- compoundtag = new CompoundTag(); +- compoundtag.putInt("honey_level", i); +- itemstack.addTagElement("BlockStateTag", compoundtag); +- ItemEntity itementity = new ItemEntity(level, (double) blockpos.getX(), (double) blockpos.getY(), (double) blockpos.getZ(), itemstack); ++ nbttagcompound = new CompoundTag(); ++ nbttagcompound.putInt("honey_level", i); ++ itemstack.addTagElement("BlockStateTag", nbttagcompound); ++ ItemEntity entityitem = new ItemEntity(world, (double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ(), itemstack); + +- itementity.setDefaultPickUpDelay(); +- level.addFreshEntity(itementity); ++ entityitem.setDefaultPickUpDelay(); ++ world.addFreshEntity(entityitem); + } + } + } + +- return super.playerWillDestroy(level, blockpos, blockstate, player); ++ return super.playerWillDestroy(world, blockposition, iblockdata, entityhuman); + } + + @Override +- @Override +- public List<ItemStack> getDrops(BlockState blockstate, LootParams.Builder lootparams_builder) { +- Entity entity = (Entity) lootparams_builder.getOptionalParameter(LootContextParams.THIS_ENTITY); ++ public List<ItemStack> getDrops(IBlockData state, LootParams.Builder params) { ++ Entity entity = (Entity) params.getOptionalParameter(LootContextParams.THIS_ENTITY); + + if (entity instanceof PrimedTnt || entity instanceof Creeper || entity instanceof WitherSkull || entity instanceof WitherBoss || entity instanceof MinecartTNT) { +- BlockEntity blockentity = (BlockEntity) lootparams_builder.getOptionalParameter(LootContextParams.BLOCK_ENTITY); ++ BlockEntity tileentity = (BlockEntity) params.getOptionalParameter(LootContextParams.BLOCK_ENTITY); + +- if (blockentity instanceof BeehiveBlockEntity) { +- BeehiveBlockEntity beehiveblockentity = (BeehiveBlockEntity) blockentity; ++ if (tileentity instanceof BeehiveBlockEntity) { ++ BeehiveBlockEntity tileentitybeehive = (BeehiveBlockEntity) tileentity; + +- beehiveblockentity.emptyAllLivingFromHive((Player) null, blockstate, BeehiveBlockEntity.BeeReleaseStatus.EMERGENCY); ++ tileentitybeehive.emptyAllLivingFromHive((Player) null, state, BeehiveBlockEntity.ReleaseStatus.EMERGENCY); + } + } + +- return super.getDrops(blockstate, lootparams_builder); ++ return super.getDrops(state, params); + } + + @Override +- @Override +- public BlockState updateShape(BlockState blockstate, Direction direction, BlockState blockstate1, LevelAccessor levelaccessor, BlockPos blockpos, BlockPos blockpos1) { +- if (levelaccessor.getBlockState(blockpos1).getBlock() instanceof FireBlock) { +- BlockEntity blockentity = levelaccessor.getBlockEntity(blockpos); ++ public IBlockData updateShape(IBlockData state, Direction facing, IBlockData facingState, LevelAccessor level, BlockPos currentPos, BlockPos facingPos) { ++ if (level.getBlockState(facingPos).getBlock() instanceof FireBlock) { ++ BlockEntity tileentity = level.getBlockEntity(currentPos); + +- if (blockentity instanceof BeehiveBlockEntity) { +- BeehiveBlockEntity beehiveblockentity = (BeehiveBlockEntity) blockentity; ++ if (tileentity instanceof BeehiveBlockEntity) { ++ BeehiveBlockEntity tileentitybeehive = (BeehiveBlockEntity) tileentity; + +- beehiveblockentity.emptyAllLivingFromHive((Player) null, blockstate, BeehiveBlockEntity.BeeReleaseStatus.EMERGENCY); ++ tileentitybeehive.emptyAllLivingFromHive((Player) null, state, BeehiveBlockEntity.ReleaseStatus.EMERGENCY); + } + } + +- return super.updateShape(blockstate, direction, blockstate1, levelaccessor, blockpos, blockpos1); ++ return super.updateShape(state, facing, facingState, level, currentPos, facingPos); + } + + @Override +- @Override +- public BlockState rotate(BlockState blockstate, Rotation rotation) { +- return (BlockState) blockstate.setValue(BeehiveBlock.FACING, rotation.rotate((Direction) blockstate.getValue(BeehiveBlock.FACING))); ++ public IBlockData rotate(IBlockData state, Rotation rotation) { ++ return (IBlockData) state.setValue(BeehiveBlock.FACING, rotation.rotate((Direction) state.getValue(BeehiveBlock.FACING))); + } + + @Override +- @Override +- public BlockState mirror(BlockState blockstate, Mirror mirror) { +- return blockstate.rotate(mirror.getRotation((Direction) blockstate.getValue(BeehiveBlock.FACING))); ++ public IBlockData mirror(IBlockData state, Mirror mirror) { ++ return state.rotate(mirror.getRotation((Direction) state.getValue(BeehiveBlock.FACING))); + } + } |