mojira.dev
MC-157896

Entity's range to render doesn't respect the rendering bounding box

How to reproduce

  • Make sure your render distance is less than 8 chunks

/summon minecart ~ ~54 ~ {CustomDisplayTile:1,DisplayState:{Name:"stone"},DisplayOffset:-1152,NoGravity:1}
/summon minecart ~-2 ~60 ~ {CustomDisplayTile:1,DisplayState:{Name:"stone"},DisplayOffset:-1280,NoGravity:1}
  • Face west, fly up and see how the second minecart appears

This causes minecarts to not render the custom display block properly in certain cases.

Code analysis (official mappings)

public boolean shouldRenderAtSqrDistance(double distance) {
   double d0 = this.getBoundingBox().getSize();
   if (Double.isNaN(d0)) {
      d0 = 1.0D;
   }

   d0 *= 64.0D * viewScale;
   return distance < d0 * d0;
}

This method should probably use getBoundingBoxForCulling instead of getBoundingBox

An entity's culling bounding box is different from the physical bounding box only in the case of minecarts and illusioners so this bug only affects these two entities.

Comments 1

Can confirm in 1.17.1.

Zonteek

(Unassigned)

Confirmed

Camera, Entities, Rendering

1.14.4, 19w35a, 19w38b, 19w39a, 19w41a, ..., 1.16.5, 1.17 Pre-release 2, 1.17.1, 22w05a, 1.21

Retrieved