From e930e62436ce8e061c2d703f00e3f6fd473074cb Mon Sep 17 00:00:00 2001 From: JozsefA Date: Sat, 6 Mar 2021 15:08:46 -0800 Subject: [PATCH] Belting these bugs. - Belts now always render their items again. - Items on belts on contraptions are now at least somewhat lit. --- .../content/contraptions/base/KineticTileEntity.java | 1 + .../content/contraptions/relays/belt/BeltRenderer.java | 7 +++++-- .../content/contraptions/relays/belt/BeltTileEntity.java | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/simibubi/create/content/contraptions/base/KineticTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/base/KineticTileEntity.java index d0ca45720..c12fa785a 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/base/KineticTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/base/KineticTileEntity.java @@ -225,6 +225,7 @@ public abstract class KineticTileEntity extends SmartTileEntity boolean overStressedBefore = overStressed; clearKineticInformation(); + cachedBoundingBox = null; // DO NOT READ kinetic information when placed after movement if (wasMoved) { super.read(compound, clientPacket); diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltRenderer.java index 0c2593245..c78922e49 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltRenderer.java @@ -20,6 +20,7 @@ import com.simibubi.create.foundation.utility.AnimationTickHolder; import com.simibubi.create.foundation.utility.Iterate; import com.simibubi.create.foundation.utility.MatrixStacker; +import com.simibubi.create.foundation.utility.worldWrappers.WrappedWorld; import net.minecraft.block.BlockState; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.IRenderTypeBuffer; @@ -45,7 +46,7 @@ public class BeltRenderer extends SafeTileEntityRenderer { @Override public boolean isGlobalRenderer(BeltTileEntity te) { - return BeltBlock.canTransportObjects(te.getBlockState()); + return te.isController(); } @Override @@ -189,6 +190,8 @@ public class BeltRenderer extends SafeTileEntityRenderer { boolean slopeAlongX = beltFacing .getAxis() == Axis.X; + boolean onContraption = te.getWorld() instanceof WrappedWorld; + for (TransportedItemStack transported : te.getInventory() .getTransportedItems()) { ms.push(); @@ -203,7 +206,7 @@ public class BeltRenderer extends SafeTileEntityRenderer { sideOffset = transported.sideOffset; } - int stackLight = getPackedLight(te, offset); + int stackLight = onContraption ? light : getPackedLight(te, offset); if (offset < .5) verticalMovement = 0; diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltTileEntity.java index f26ebceed..a55c23825 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltTileEntity.java @@ -521,7 +521,7 @@ public class BeltTileEntity extends KineticTileEntity { @Override public boolean shouldRenderAsTE() { - return BeltBlock.canTransportObjects(getBlockState()); + return isController(); } private void updateLight() {