From 9c42988135301dcf11980a59b8e05969a2d237f4 Mon Sep 17 00:00:00 2001 From: Jozufozu Date: Sat, 5 Feb 2022 12:43:28 -0800 Subject: [PATCH] Portable clipping interface - Fix PSI z-fighting --- .../actors/PortableStorageInterfaceRenderer.java | 3 +++ .../components/flywheel/engine/EngineInstance.java | 7 +++---- .../components/flywheel/engine/FurnaceEngineBlock.java | 3 +-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/actors/PortableStorageInterfaceRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/components/actors/PortableStorageInterfaceRenderer.java index 39ff32874..87bcb8836 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/actors/PortableStorageInterfaceRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/actors/PortableStorageInterfaceRenderer.java @@ -2,6 +2,7 @@ package com.simibubi.create.content.contraptions.components.actors; import java.util.function.Consumer; +import com.jozufozu.flywheel.backend.Backend; import com.jozufozu.flywheel.core.PartialModel; import com.jozufozu.flywheel.core.virtual.VirtualRenderWorld; import com.mojang.blaze3d.vertex.PoseStack; @@ -34,6 +35,8 @@ public class PortableStorageInterfaceRenderer extends SafeTileEntityRenderer { Block block = blockState .getBlock(); - if (!(block instanceof EngineBlock)) + if (!(block instanceof EngineBlock engineBlock)) return; - EngineBlock engineBlock = (EngineBlock) block; - PartialModel frame = engineBlock.getFrameModel(); + PartialModel frame = engineBlock.getFrameModel(); Direction facing = blockState.getValue(BlockStateProperties.HORIZONTAL_FACING); @@ -33,7 +32,7 @@ public class EngineInstance extends BlockEntityInstance { this.frame.loadIdentity() .translate(getInstancePosition()) - .nudge(tile.hashCode()) + .nudge(pos.hashCode()) .centre() .rotate(Direction.UP, angle) .unCentre() diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/flywheel/engine/FurnaceEngineBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/flywheel/engine/FurnaceEngineBlock.java index a470f3de7..be69f1a3e 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/flywheel/engine/FurnaceEngineBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/flywheel/engine/FurnaceEngineBlock.java @@ -66,9 +66,8 @@ public class FurnaceEngineBlock extends EngineBlock implements ITE