aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/ftbsc/bscv/modules/vision/StorageESP.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/main/java/ftbsc/bscv/modules/vision/StorageESP.java b/src/main/java/ftbsc/bscv/modules/vision/StorageESP.java
index 975da95..47553e3 100644
--- a/src/main/java/ftbsc/bscv/modules/vision/StorageESP.java
+++ b/src/main/java/ftbsc/bscv/modules/vision/StorageESP.java
@@ -32,6 +32,7 @@ import net.minecraft.tileentity.ShulkerBoxTileEntity;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TrappedChestTileEntity;
import net.minecraft.util.math.AxisAlignedBB;
+import net.minecraft.util.math.shapes.VoxelShape;
import net.minecraft.util.math.vector.Vector3d;
import net.minecraft.util.math.vector.Vector3f;
import net.minecraftforge.client.event.RenderWorldLastEvent;
@@ -112,8 +113,11 @@ public class StorageESP extends QuickModule {
for (TileEntity ent : MC.level.tickableBlockEntities) {
Vector3f color = this.tileHighlight(ent);
if (color != null) {
- AxisAlignedBB bounds = ent.getBlockState().getCollisionShape(MC.level, ent.getBlockPos()).bounds().move(ent.getBlockPos());
- WorldRenderer.renderLineBox(stack, builder, bounds, color.x(), color.y(), color.z(), this.alpha.get().floatValue());
+ VoxelShape shape = ent.getBlockState().getCollisionShape(MC.level, ent.getBlockPos());
+ if (!shape.isEmpty()) { // this might be null in some rare occurrences, just skip rendering this block for this frame
+ AxisAlignedBB bounds = shape.bounds().move(ent.getBlockPos());
+ WorldRenderer.renderLineBox(stack, builder, bounds, color.x(), color.y(), color.z(), this.alpha.get().floatValue());
+ }
}
}