From 926f5654de2e34d575b2a79c8ed5ac7114ba7cd8 Mon Sep 17 00:00:00 2001 From: Ghzdude <44148655+ghzdude@users.noreply.github.com> Date: Sun, 7 Jul 2024 12:40:21 -0700 Subject: [PATCH 1/3] check for TEs to not delete them --- .../java/gregtech/api/capability/impl/miner/MinerLogic.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/gregtech/api/capability/impl/miner/MinerLogic.java b/src/main/java/gregtech/api/capability/impl/miner/MinerLogic.java index 5b1ca454f3d..9f95bf16c52 100644 --- a/src/main/java/gregtech/api/capability/impl/miner/MinerLogic.java +++ b/src/main/java/gregtech/api/capability/impl/miner/MinerLogic.java @@ -157,8 +157,9 @@ public void performMining() { // drill a hole beneath the miner and extend the pipe downwards by one WorldServer world = (WorldServer) metaTileEntity.getWorld(); if (mineY.get() < pipeY.get()) { - world.destroyBlock( - new BlockPos(metaTileEntity.getPos().getX(), pipeY.get(), metaTileEntity.getPos().getZ()), false); + var pipePos = new BlockPos(metaTileEntity.getPos().getX(), pipeY.get(), metaTileEntity.getPos().getZ()); + if (world.getTileEntity(pipePos) == null) + world.destroyBlock(pipePos, false); pipeY.decrementAndGet(); incrementPipeLength(); } From b88291f118b484c003f9725a83e21e5fb2faff5b Mon Sep 17 00:00:00 2001 From: Ghzdude <44148655+ghzdude@users.noreply.github.com> Date: Sun, 7 Jul 2024 13:14:17 -0700 Subject: [PATCH 2/3] check block hardness as well --- .../java/gregtech/api/capability/impl/miner/MinerLogic.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/gregtech/api/capability/impl/miner/MinerLogic.java b/src/main/java/gregtech/api/capability/impl/miner/MinerLogic.java index 9f95bf16c52..5533e6af718 100644 --- a/src/main/java/gregtech/api/capability/impl/miner/MinerLogic.java +++ b/src/main/java/gregtech/api/capability/impl/miner/MinerLogic.java @@ -158,7 +158,7 @@ public void performMining() { WorldServer world = (WorldServer) metaTileEntity.getWorld(); if (mineY.get() < pipeY.get()) { var pipePos = new BlockPos(metaTileEntity.getPos().getX(), pipeY.get(), metaTileEntity.getPos().getZ()); - if (world.getTileEntity(pipePos) == null) + if (world.getTileEntity(pipePos) == null && world.getBlockState(pipePos).getBlockHardness(world, pipePos) >= 0) world.destroyBlock(pipePos, false); pipeY.decrementAndGet(); incrementPipeLength(); From 5cc4192dec78924a24f2dc9435995cb721ff44b6 Mon Sep 17 00:00:00 2001 From: Ghzdude <44148655+ghzdude@users.noreply.github.com> Date: Sun, 7 Jul 2024 13:19:24 -0700 Subject: [PATCH 3/3] spotless aaa --- .../java/gregtech/api/capability/impl/miner/MinerLogic.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/gregtech/api/capability/impl/miner/MinerLogic.java b/src/main/java/gregtech/api/capability/impl/miner/MinerLogic.java index 5533e6af718..3439aca4a57 100644 --- a/src/main/java/gregtech/api/capability/impl/miner/MinerLogic.java +++ b/src/main/java/gregtech/api/capability/impl/miner/MinerLogic.java @@ -158,7 +158,8 @@ public void performMining() { WorldServer world = (WorldServer) metaTileEntity.getWorld(); if (mineY.get() < pipeY.get()) { var pipePos = new BlockPos(metaTileEntity.getPos().getX(), pipeY.get(), metaTileEntity.getPos().getZ()); - if (world.getTileEntity(pipePos) == null && world.getBlockState(pipePos).getBlockHardness(world, pipePos) >= 0) + if (world.getTileEntity(pipePos) == null && + world.getBlockState(pipePos).getBlockHardness(world, pipePos) >= 0) world.destroyBlock(pipePos, false); pipeY.decrementAndGet(); incrementPipeLength();