mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-11-10 20:45:10 +01:00
all belts render correctly
This commit is contained in:
parent
5144aa6e63
commit
a52b606208
@ -64,10 +64,11 @@ public class BeltRenderer extends SafeTileEntityRenderer<BeltTileEntity> {
|
|||||||
boolean start = part == BeltPart.START;
|
boolean start = part == BeltPart.START;
|
||||||
boolean end = part == BeltPart.END;
|
boolean end = part == BeltPart.END;
|
||||||
boolean sideways = beltSlope == BeltSlope.SIDEWAYS;
|
boolean sideways = beltSlope == BeltSlope.SIDEWAYS;
|
||||||
|
boolean vertical = beltSlope == BeltSlope.VERTICAL;
|
||||||
boolean alongX = facing.getAxis() == Axis.X;
|
boolean alongX = facing.getAxis() == Axis.X;
|
||||||
boolean alongZ = facing.getAxis() == Axis.Z;
|
boolean alongZ = facing.getAxis() == Axis.Z;
|
||||||
|
|
||||||
if (downward || beltSlope == BeltSlope.VERTICAL && axisDirection == AxisDirection.POSITIVE) {
|
if (downward || vertical && axisDirection == AxisDirection.POSITIVE) {
|
||||||
boolean b = start;
|
boolean b = start;
|
||||||
start = end;
|
start = end;
|
||||||
end = b;
|
end = b;
|
||||||
@ -90,16 +91,17 @@ public class BeltRenderer extends SafeTileEntityRenderer<BeltTileEntity> {
|
|||||||
|
|
||||||
beltBuffer.setupInstance(data -> {
|
beltBuffer.setupInstance(data -> {
|
||||||
float speed = te.getSpeed();
|
float speed = te.getSpeed();
|
||||||
if (((axisDirection == AxisDirection.NEGATIVE) ^ upward) ^ ((alongX && !diagonal) || (alongZ && diagonal)))
|
if (((axisDirection == AxisDirection.NEGATIVE) ^ upward) ^
|
||||||
|
((alongX && !diagonal) || (alongZ && diagonal)) ^
|
||||||
|
vertical)
|
||||||
speed = -speed;
|
speed = -speed;
|
||||||
|
|
||||||
float horizontalAngle = facing.getHorizontalAngle();
|
float rotX = !diagonal && beltSlope != BeltSlope.HORIZONTAL ? 90 : 0;
|
||||||
|
float rotY = facing.getHorizontalAngle() + (upward ? 180 : 0) + (sideways ? 270 : 0);
|
||||||
|
float rotZ = sideways ? 90 : (vertical ? 180 : 0);
|
||||||
|
|
||||||
data.setPosition(te.getPos())
|
data.setPosition(te.getPos())
|
||||||
.setRotation(
|
.setRotation(rotX, rotY, rotZ)
|
||||||
!diagonal && beltSlope != BeltSlope.HORIZONTAL ? 90 : 0,
|
|
||||||
horizontalAngle + (upward ? 180 : 0) + (sideways ? 270 : 0),
|
|
||||||
sideways ? 90 : 0
|
|
||||||
)
|
|
||||||
.setPackedLight(light)
|
.setPackedLight(light)
|
||||||
.setRotationalSpeed(speed)
|
.setRotationalSpeed(speed)
|
||||||
.setScrollTexture(spriteShift)
|
.setScrollTexture(spriteShift)
|
||||||
|
Loading…
Reference in New Issue
Block a user