From 54e6c934ea1e599ef9fffc76d79b2497005ad043 Mon Sep 17 00:00:00 2001 From: Yarden Zamir Date: Sat, 3 Feb 2024 15:01:54 +0200 Subject: [PATCH] fix blockstate being used twice instead of blockstate2, which is now newBlockState --- src/main/java/com/kikis/ptdyeplus/block/Barrel.java | 7 ++++--- src/main/java/com/kikis/ptdyeplus/block/Crate.java | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/kikis/ptdyeplus/block/Barrel.java b/src/main/java/com/kikis/ptdyeplus/block/Barrel.java index b48d98c..29a67cd 100644 --- a/src/main/java/com/kikis/ptdyeplus/block/Barrel.java +++ b/src/main/java/com/kikis/ptdyeplus/block/Barrel.java @@ -66,16 +66,17 @@ public InteractionResult use(BlockState blockState, Level level, BlockPos blockP } @Override - public void onRemove(BlockState blockState, Level level, BlockPos blockPos, BlockState blockState2, boolean p_60519_) { - if (!blockState.is(blockState2.getBlock())) { + public void onRemove(BlockState blockState, Level level, BlockPos blockPos, BlockState newBlockState, boolean p_60519_) { + if (!blockState.is(newBlockState.getBlock())) { BlockEntity entity = level.getBlockEntity(blockPos); if (entity instanceof Container container) { Containers.dropContents(level, blockPos, container); level.updateNeighbourForOutputSignal(blockPos, this); } - super.onRemove(blockState, level, blockPos, blockState, p_60519_); + super.onRemove(blockState, level, blockPos, newBlockState, p_60519_); } + } @Nullable diff --git a/src/main/java/com/kikis/ptdyeplus/block/Crate.java b/src/main/java/com/kikis/ptdyeplus/block/Crate.java index 2dff73a..462ff22 100644 --- a/src/main/java/com/kikis/ptdyeplus/block/Crate.java +++ b/src/main/java/com/kikis/ptdyeplus/block/Crate.java @@ -67,15 +67,15 @@ public InteractionResult use(BlockState blockState, Level level, BlockPos blockP } @Override - public void onRemove(BlockState blockState, Level level, BlockPos blockPos, BlockState blockState2, boolean p_60519_) { - if (!blockState.is(blockState2.getBlock())) { + public void onRemove(BlockState blockState, Level level, BlockPos blockPos, BlockState newBlockState, boolean p_60519_) { + if (!blockState.is(newBlockState.getBlock())) { BlockEntity entity = level.getBlockEntity(blockPos); if (entity instanceof Container container) { Containers.dropContents(level, blockPos, container); level.updateNeighbourForOutputSignal(blockPos, this); } - super.onRemove(blockState, level, blockPos, blockState, p_60519_); + super.onRemove(blockState, level, blockPos, newBlockState, p_60519_); } }