diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBreaker.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBreaker.java index 7f69b22fb..d9c0fbee2 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBreaker.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBreaker.java @@ -78,16 +78,20 @@ public class TileEntityBreaker extends TileEntityInventoryBase implements MenuPr public static void serverTick(Level level, BlockPos pos, BlockState state, T t) { if (t instanceof TileEntityBreaker tile) { tile.serverTick(); + } + } - if (!tile.isRedstonePowered && !tile.isPulseMode) { - if (tile.currentTime > 0) { - tile.currentTime--; - if (tile.currentTime <= 0) { - tile.doWork(); - } - } else { - tile.currentTime = 15; + @Override + protected void serverTick() { + super.serverTick(); + if (!isRedstonePowered && !isPulseMode) { + if (currentTime > 0) { + currentTime--; + if (currentTime <= 0) { + doWork(); } + } else { + currentTime = 15; } } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/util/WorldUtil.java b/src/main/java/de/ellpeck/actuallyadditions/mod/util/WorldUtil.java index e52e82657..48be7f11f 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/util/WorldUtil.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/util/WorldUtil.java @@ -23,6 +23,7 @@ import net.minecraft.world.entity.item.ItemEntity; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; +import net.minecraft.world.item.context.BlockPlaceContext; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Blocks; @@ -165,8 +166,9 @@ public final class WorldUtil { if (level instanceof ServerLevel && StackUtil.isValid(stack) && pos != null) { BlockPos offsetPos = pos.relative(side); BlockState state = level.getBlockState(offsetPos); - Block block = state.getBlock(); - boolean replaceable = false; //= block.canBeReplaced(world, offsetPos); //TODO + boolean replaceable = state.canBeReplaced(new BlockPlaceContext(level, null, InteractionHand.MAIN_HAND, stack, + new BlockHitResult(new Vec3(0, 0, 0), side, pos, false) + )); //Redstone if (replaceable && stack.getItem() == Items.REDSTONE) {