Fix Custom Hitboxes not working on Custom Entities / Models

This commit is contained in:
Kam committed 2024-03-01 15:20:39 -05:00
1 parent 1e51d6b243
commit 269bb8346e
1 file changed
+11
@@ -72,11 +72,22 @@ public class EntityCustomNpc extends EntityNPCFlying {
((EntityNPCInterface)entity).updateHitbox();
width = (entity.width / 5f) * display.modelSize;
height = (entity.height / 5f) * display.modelSize;
if(display.hitboxData.isHitboxEnabled()){
width = width * display.hitboxData.getWidthScale();
height = height * display.hitboxData.getHeightScale();
}
if(width < 0.1f)
width = 0.1f;
if(height < 0.1f)
height = 0.1f;
if(isKilled() && stats.hideKilledBody){
width = 0.00001f;
}
if(width / 2 > worldObj.MAX_ENTITY_RADIUS) {
worldObj.MAX_ENTITY_RADIUS = width / 2;
}
this.setPosition(posX, posY, posZ);
}
}