(BugFix): Fix powder chest being registered while in opening animation

This commit is contained in:
illyum 2024-08-23 06:47:05 -06:00
parent 9749a3199a
commit ebfbd6fc74

View File

@ -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,6 +99,9 @@ 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 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)
@ -106,6 +110,8 @@ object ChestEsp {
}
}
}
}
}
checkChestLocations()
}