From ebfbd6fc74e6114afba8c5c3893cffceebd0323e Mon Sep 17 00:00:00 2001 From: illyum <90023277+itzilly@users.noreply.github.com> Date: Fri, 23 Aug 2024 06:47:05 -0600 Subject: [PATCH] (BugFix): Fix powder chest being registered while in opening animation --- .../com/github/itzilly/sbt/features/ChestEsp.kt | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/com/github/itzilly/sbt/features/ChestEsp.kt b/src/main/kotlin/com/github/itzilly/sbt/features/ChestEsp.kt index a4834a8..537011a 100644 --- a/src/main/kotlin/com/github/itzilly/sbt/features/ChestEsp.kt +++ b/src/main/kotlin/com/github/itzilly/sbt/features/ChestEsp.kt @@ -13,6 +13,7 @@ import net.minecraft.client.renderer.GlStateManager import net.minecraft.init.Blocks import net.minecraft.util.BlockPos import net.minecraft.entity.Entity +import net.minecraft.tileentity.TileEntityChest import net.minecraft.util.AxisAlignedBB import net.minecraft.util.MovingObjectPosition import net.minecraftforge.client.event.ClientChatReceivedEvent @@ -98,9 +99,14 @@ object ChestEsp { for (z in boundZMin.toInt()..boundZMax.toInt()) { val block = world.getBlockState(BlockPos(x, y, z)).block if (block == Blocks.chest || block == Blocks.trapped_chest || block == Blocks.ender_chest) { - val point = ChestNode(x, y, z) - if (!chestNodeExists(x, y, z)) { - chestList.add(point) + val tileEntity = world.getTileEntity(BlockPos(x, y, z)) + if (tileEntity is TileEntityChest) { + if (tileEntity.numPlayersUsing != 0) { + val point = ChestNode(x, y, z) + if (!chestNodeExists(x, y, z)) { + chestList.add(point) + } + } } } }