From 688c348780ecac33f721a68b64dba9d86f6c4ac3 Mon Sep 17 00:00:00 2001 From: ChomeNS <95471003+ChomeNS@users.noreply.github.com> Date: Tue, 27 Jun 2023 20:44:14 +0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=AA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chayapak/chomens_bot/plugins/CorePlugin.java | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/CorePlugin.java b/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/CorePlugin.java index b8953d5..2424f13 100644 --- a/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/CorePlugin.java +++ b/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/CorePlugin.java @@ -6,6 +6,7 @@ import com.github.steveice10.mc.protocol.data.game.entity.player.Hand; import com.github.steveice10.mc.protocol.data.game.entity.player.PlayerAction; import com.github.steveice10.mc.protocol.data.game.level.block.BlockChangeEntry; import com.github.steveice10.mc.protocol.data.game.level.block.BlockEntityInfo; +import com.github.steveice10.mc.protocol.data.game.level.block.BlockEntityType; import com.github.steveice10.mc.protocol.data.game.level.block.CommandBlockMode; import com.github.steveice10.mc.protocol.packet.ingame.clientbound.level.ClientboundBlockUpdatePacket; import com.github.steveice10.mc.protocol.packet.ingame.clientbound.level.ClientboundLevelChunkWithLightPacket; @@ -237,22 +238,13 @@ public class CorePlugin extends PositionPlugin.Listener { public void packetReceived (ClientboundLevelChunkWithLightPacket packet) { boolean hasCoreY = false; for (BlockEntityInfo info : packet.getBlockEntities()) { - if (info.getY() >= fromSize.getY() && info.getY() <= toSize.getY()) { + if (info.getY() >= fromSize.getY() && info.getY() <= toSize.getY() && info.getType() == BlockEntityType.COMMAND_BLOCK) { hasCoreY = true; break; } } - if ( - ( - from.getX() / 16 == packet.getX() || - from.getZ() / 16 == packet.getZ() || - - to.getX() / 16 == packet.getX() || - to.getZ() / 16 == packet.getZ() - ) && - hasCoreY - ) refill(); + if (hasCoreY) refill(); } // ported from chomens bot js