Should fix crash with wrenched storage units. Closes #2183

This commit is contained in:
drcrazy 2020-09-24 23:30:25 +03:00
parent a44370f5e6
commit 22b0cdfe23

View file

@ -82,9 +82,12 @@ public class StorageUnitRenderer extends BlockEntityRenderer<StorageUnitBaseBloc
TextRenderer textRenderer = this.dispatcher.getTextRenderer();
Direction facing = storage.getFacing();
matrices.translate(0.5, 0.5, 0.5); // Translate center
matrices.multiply(Vector3f.POSITIVE_Y.getDegreesQuaternion(-facing.rotateYCounterclockwise().asRotation() + 90)); // Rotate depending on face
matrices.translate(0, 0, -0.505); // Translate forward
// Render item only on horizontal facing #2183
if (Direction.Type.HORIZONTAL.test(facing) ){
matrices.translate(0.5, 0.5, 0.5); // Translate center
matrices.multiply(Vector3f.POSITIVE_Y.getDegreesQuaternion(-facing.rotateYCounterclockwise().asRotation() + 90)); // Rotate depending on face
matrices.translate(0, 0, -0.505); // Translate forward
}
matrices.scale(-0.01f, -0.01F, -0.01f);