mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2025-02-13 16:24:23 +01:00
Integrate with the vanilla minecraft's bounding box debugger
This commit is contained in:
parent
5e56f5101f
commit
0624da539d
1 changed files with 9 additions and 2 deletions
|
@ -19,9 +19,16 @@ public class DebugBoundingBoxRenderer {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void render(IPony pony, EntityLivingBase entity, float ticks) {
|
public void render(IPony pony, EntityLivingBase entity, float ticks) {
|
||||||
|
Minecraft mc = Minecraft.getMinecraft();
|
||||||
|
EntityPlayer player = mc.player;
|
||||||
|
|
||||||
|
if (!mc.getRenderManager().isDebugBoundingBox() || entity.getDistanceSq(player) > 70) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
AxisAlignedBB boundingBox = pony.getComputedBoundingBox(entity);
|
AxisAlignedBB boundingBox = pony.getComputedBoundingBox(entity);
|
||||||
|
|
||||||
EntityPlayer player = Minecraft.getMinecraft().player;
|
|
||||||
double renderPosX = player.lastTickPosX + (player.posX - player.lastTickPosX) * (double)ticks;
|
double renderPosX = player.lastTickPosX + (player.posX - player.lastTickPosX) * (double)ticks;
|
||||||
double renderPosY = player.lastTickPosY + (player.posY - player.lastTickPosY) * (double)ticks;
|
double renderPosY = player.lastTickPosY + (player.posY - player.lastTickPosY) * (double)ticks;
|
||||||
double renderPosZ = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * (double)ticks;
|
double renderPosZ = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * (double)ticks;
|
||||||
|
@ -32,7 +39,7 @@ public class DebugBoundingBoxRenderer {
|
||||||
disableTexture2D();
|
disableTexture2D();
|
||||||
depthMask(false);
|
depthMask(false);
|
||||||
|
|
||||||
RenderGlobal.drawSelectionBoundingBox(boundingBox.grow(0.002D).offset(-renderPosX, -renderPosY, -renderPosZ), 1, 1, 1, 1);
|
RenderGlobal.drawSelectionBoundingBox(boundingBox.grow(0.003D).offset(-renderPosX, -renderPosY, -renderPosZ), 1, 1, 0, 1);
|
||||||
|
|
||||||
depthMask(true);
|
depthMask(true);
|
||||||
enableTexture2D();
|
enableTexture2D();
|
||||||
|
|
Loading…
Reference in a new issue