0
0
mirror of https://github.com/Wurst-Imperium/Wurst7.git synced 2024-09-20 17:20:12 +02:00

Fix ChestESP crash

This commit is contained in:
Alexander01998 2021-02-12 22:18:52 +01:00
parent 8e4eea6ad4
commit 5ee90606fa

View File

@ -20,6 +20,7 @@ import net.minecraft.block.entity.EnderChestBlockEntity;
import net.minecraft.block.entity.ShulkerBoxBlockEntity;
import net.minecraft.block.entity.TrappedChestBlockEntity;
import net.minecraft.block.enums.ChestType;
import net.minecraft.client.render.block.entity.BlockEntityRenderDispatcher;
import net.minecraft.entity.Entity;
import net.minecraft.entity.vehicle.ChestMinecartEntity;
import net.minecraft.util.math.BlockPos;
@ -185,16 +186,19 @@ public class ChestEspHack extends Hack implements UpdateListener,
basicChests.add(bb);
}
BlockPos camPos = RenderUtils.getCameraBlockPos();
int regionX = (camPos.getX() >> 9) * 512;
int regionZ = (camPos.getZ() >> 9) * 512;
GL11.glNewList(normalChests, GL11.GL_COMPILE);
renderBoxes(basicChests, greenBox, regionX, regionZ);
renderBoxes(trappedChests, orangeBox, regionX, regionZ);
renderBoxes(enderChests, cyanBox, regionX, regionZ);
renderBoxes(shulkerBoxes, purpleBox, regionX, regionZ);
GL11.glEndList();
if(BlockEntityRenderDispatcher.INSTANCE.camera != null)
{
BlockPos camPos = RenderUtils.getCameraBlockPos();
int regionX = (camPos.getX() >> 9) * 512;
int regionZ = (camPos.getZ() >> 9) * 512;
GL11.glNewList(normalChests, GL11.GL_COMPILE);
renderBoxes(basicChests, greenBox, regionX, regionZ);
renderBoxes(trappedChests, orangeBox, regionX, regionZ);
renderBoxes(enderChests, cyanBox, regionX, regionZ);
renderBoxes(shulkerBoxes, purpleBox, regionX, regionZ);
GL11.glEndList();
}
minecarts.clear();
for(Entity entity : MC.world.getEntities())