Portable clipping interface

- Fix PSI z-fighting
This commit is contained in:
Jozufozu 2022-02-05 12:43:28 -08:00
parent 00555ff572
commit 9c42988135
3 changed files with 7 additions and 6 deletions

View File

@ -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<Por
@Override
protected void renderSafe(PortableStorageInterfaceTileEntity te, float partialTicks, PoseStack ms,
MultiBufferSource buffer, int light, int overlay) {
if (Backend.isOn()) return;
BlockState blockState = te.getBlockState();
float progress = te.getExtensionDistance(partialTicks);
VertexConsumer vb = buffer.getBuffer(RenderType.solid());

View File

@ -19,11 +19,10 @@ public class EngineInstance extends BlockEntityInstance<EngineTileEntity> {
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<EngineTileEntity> {
this.frame.loadIdentity()
.translate(getInstancePosition())
.nudge(tile.hashCode())
.nudge(pos.hashCode())
.centre()
.rotate(Direction.UP, angle)
.unCentre()

View File

@ -66,9 +66,8 @@ public class FurnaceEngineBlock extends EngineBlock implements ITE<FurnaceEngine
@SubscribeEvent
public static void usingFurnaceEngineOnFurnacePreventsGUI(RightClickBlock event) {
ItemStack item = event.getItemStack();
if (!(item.getItem() instanceof BlockItem))
if (!(item.getItem() instanceof BlockItem blockItem))
return;
BlockItem blockItem = (BlockItem) item.getItem();
if (blockItem.getBlock() != AllBlocks.FURNACE_ENGINE.get())
return;
BlockState state = event.getWorld().getBlockState(event.getPos());