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 java.util.function.Consumer;
import com.jozufozu.flywheel.backend.Backend;
import com.jozufozu.flywheel.core.PartialModel; import com.jozufozu.flywheel.core.PartialModel;
import com.jozufozu.flywheel.core.virtual.VirtualRenderWorld; import com.jozufozu.flywheel.core.virtual.VirtualRenderWorld;
import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.PoseStack;
@ -34,6 +35,8 @@ public class PortableStorageInterfaceRenderer extends SafeTileEntityRenderer<Por
@Override @Override
protected void renderSafe(PortableStorageInterfaceTileEntity te, float partialTicks, PoseStack ms, protected void renderSafe(PortableStorageInterfaceTileEntity te, float partialTicks, PoseStack ms,
MultiBufferSource buffer, int light, int overlay) { MultiBufferSource buffer, int light, int overlay) {
if (Backend.isOn()) return;
BlockState blockState = te.getBlockState(); BlockState blockState = te.getBlockState();
float progress = te.getExtensionDistance(partialTicks); float progress = te.getExtensionDistance(partialTicks);
VertexConsumer vb = buffer.getBuffer(RenderType.solid()); VertexConsumer vb = buffer.getBuffer(RenderType.solid());

View file

@ -19,11 +19,10 @@ public class EngineInstance extends BlockEntityInstance<EngineTileEntity> {
Block block = blockState Block block = blockState
.getBlock(); .getBlock();
if (!(block instanceof EngineBlock)) if (!(block instanceof EngineBlock engineBlock))
return; return;
EngineBlock engineBlock = (EngineBlock) block; PartialModel frame = engineBlock.getFrameModel();
PartialModel frame = engineBlock.getFrameModel();
Direction facing = blockState.getValue(BlockStateProperties.HORIZONTAL_FACING); Direction facing = blockState.getValue(BlockStateProperties.HORIZONTAL_FACING);
@ -33,7 +32,7 @@ public class EngineInstance extends BlockEntityInstance<EngineTileEntity> {
this.frame.loadIdentity() this.frame.loadIdentity()
.translate(getInstancePosition()) .translate(getInstancePosition())
.nudge(tile.hashCode()) .nudge(pos.hashCode())
.centre() .centre()
.rotate(Direction.UP, angle) .rotate(Direction.UP, angle)
.unCentre() .unCentre()

View file

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