mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-12-27 23:47:38 +01:00
Portable clipping interface
- Fix PSI z-fighting
This commit is contained in:
parent
00555ff572
commit
9c42988135
3 changed files with 7 additions and 6 deletions
|
@ -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());
|
||||||
|
|
|
@ -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()
|
||||||
|
|
|
@ -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());
|
||||||
|
|
Loading…
Reference in a new issue