Skip to content

Commit

Permalink
Add htibox rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
WenXin20 committed Jan 24, 2025
1 parent 6657581 commit b0dc44c
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,13 @@ protected void applyRotations(PiranhaPlantEntity animatable, PoseStack poseStack
}

private static void renderHitboxes(PoseStack poseStack, VertexConsumer vertexConsumer, PiranhaPlantEntity entity) {
AABB customBoundingBox = entity.makeBoundingBox();
AABB relativeBox = customBoundingBox.move(-entity.getX(), -entity.getY(), -entity.getZ());
AABB relativeBoxInflate = customBoundingBox.move(-entity.getX(), -entity.getY(), -entity.getZ()).inflate(0.01);
AABB mainBoundingBox = entity.makeBoundingBox();
AABB headBoundingBox = entity.head.makeBoundingBox();
AABB relativeBox = mainBoundingBox.move(-entity.getX(), -entity.getY(), -entity.getZ());
AABB relativeBoxInflate = mainBoundingBox.move(-entity.getX(), -entity.getY(), -entity.getZ()).inflate(0.01);

if (entity.isMultipartEntity()) {
AABB piranhaPart = customBoundingBox.move(-entity.head.getX(), -entity.head.getY(), -entity.head.getZ());
AABB piranhaPart = headBoundingBox.move(-entity.head.getX(), -entity.head.getY(), -entity.head.getZ());

poseStack.pushPose();
LevelRenderer.renderLineBox(poseStack, vertexConsumer, piranhaPart, 0.25F, 1.0F, 0.0F, 1.0F);
Expand Down

0 comments on commit b0dc44c

Please sign in to comment.