Should fix crash with wrenched storage units. Closes #2183
This commit is contained in:
parent
a44370f5e6
commit
22b0cdfe23
1 changed files with 6 additions and 3 deletions
|
@ -82,9 +82,12 @@ public class StorageUnitRenderer extends BlockEntityRenderer<StorageUnitBaseBloc
|
||||||
TextRenderer textRenderer = this.dispatcher.getTextRenderer();
|
TextRenderer textRenderer = this.dispatcher.getTextRenderer();
|
||||||
Direction facing = storage.getFacing();
|
Direction facing = storage.getFacing();
|
||||||
|
|
||||||
matrices.translate(0.5, 0.5, 0.5); // Translate center
|
// Render item only on horizontal facing #2183
|
||||||
matrices.multiply(Vector3f.POSITIVE_Y.getDegreesQuaternion(-facing.rotateYCounterclockwise().asRotation() + 90)); // Rotate depending on face
|
if (Direction.Type.HORIZONTAL.test(facing) ){
|
||||||
matrices.translate(0, 0, -0.505); // Translate forward
|
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);
|
matrices.scale(-0.01f, -0.01F, -0.01f);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue