diff --git a/src/main/java/com/simibubi/create/content/contraptions/base/KineticTileEntityRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/base/KineticTileEntityRenderer.java index fdae33fc3..eb287ad25 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/base/KineticTileEntityRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/base/KineticTileEntityRenderer.java @@ -38,7 +38,7 @@ public class KineticTileEntityRenderer extends SafeTileEntityRenderer renderItem(te, partialTicks, ms, buffer, light, overlay); FilteringRenderer.renderOnTileEntity(te, partialTicks, ms, buffer, light, overlay); - if (Backend.getInstance().canUseInstancing(te.getLevel())) return; + if (Backend.canUseInstancing(te.getLevel())) return; renderComponents(te, partialTicks, ms, buffer, light, overlay); } @@ -113,7 +113,7 @@ public class DeployerRenderer extends SafeTileEntityRenderer protected void renderComponents(DeployerTileEntity te, float partialTicks, PoseStack ms, MultiBufferSource buffer, int light, int overlay) { VertexConsumer vb = buffer.getBuffer(RenderType.solid()); - if (!Backend.getInstance().canUseInstancing(te.getLevel())) { + if (!Backend.canUseInstancing(te.getLevel())) { KineticTileEntityRenderer.renderRotatingKineticBlock(te, getRenderedBlockState(te), ms, vb, light); } @@ -193,10 +193,10 @@ public class DeployerRenderer extends SafeTileEntityRenderer IRotate def = (IRotate) context.state.getBlock(); axis = def.getRotationAxis(context.state); } - + float time = AnimationTickHolder.getRenderTime(context.world) / 20; float angle = (time * speed) % 360; - + new MatrixTransformStack(m) .centre() .rotateY(axis == Axis.Z ? 90 : 0) diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/fan/EncasedFanRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/components/fan/EncasedFanRenderer.java index 274f95237..73b918fa7 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/fan/EncasedFanRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/fan/EncasedFanRenderer.java @@ -28,7 +28,7 @@ public class EncasedFanRenderer extends KineticTileEntityRenderer { @Override protected void renderSafe(KineticTileEntity te, float partialTicks, PoseStack ms, MultiBufferSource buffer, int light, int overlay) { - if (Backend.getInstance().canUseInstancing(te.getLevel())) return; + if (Backend.canUseInstancing(te.getLevel())) return; Direction direction = te.getBlockState() .getValue(FACING); diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/flywheel/FlywheelRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/components/flywheel/FlywheelRenderer.java index c816de46d..0b11588ba 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/flywheel/FlywheelRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/flywheel/FlywheelRenderer.java @@ -36,7 +36,7 @@ public class FlywheelRenderer extends KineticTileEntityRenderer { int light, int overlay) { super.renderSafe(te, partialTicks, ms, buffer, light, overlay); - if (Backend.getInstance().canUseInstancing(te.getLevel())) return; + if (Backend.canUseInstancing(te.getLevel())) return; BlockState blockState = te.getBlockState(); FlywheelTileEntity wte = (FlywheelTileEntity) te; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/flywheel/engine/EngineRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/components/flywheel/engine/EngineRenderer.java index 1c9c904bd..64984443a 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/flywheel/engine/EngineRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/flywheel/engine/EngineRenderer.java @@ -22,7 +22,7 @@ public class EngineRenderer extends SafeTileEntityRe protected void renderSafe(T te, float partialTicks, PoseStack ms, MultiBufferSource buffer, int light, int overlay) { - if (Backend.getInstance().canUseInstancing(te.getLevel())) return; + if (Backend.canUseInstancing(te.getLevel())) return; Block block = te.getBlockState() .getBlock(); diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/mixer/MechanicalMixerRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/components/mixer/MechanicalMixerRenderer.java index 83d05442f..ec59b2037 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/mixer/MechanicalMixerRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/mixer/MechanicalMixerRenderer.java @@ -31,7 +31,7 @@ public class MechanicalMixerRenderer extends KineticTileEntityRenderer { protected void renderSafe(KineticTileEntity te, float partialTicks, PoseStack ms, MultiBufferSource buffer, int light, int overlay) { - if (Backend.getInstance().canUseInstancing(te.getLevel())) return; + if (Backend.canUseInstancing(te.getLevel())) return; BlockState blockState = te.getBlockState(); MechanicalMixerTileEntity mixer = (MechanicalMixerTileEntity) te; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/press/MechanicalPressRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/components/press/MechanicalPressRenderer.java index 5523a7b2e..43e315100 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/press/MechanicalPressRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/press/MechanicalPressRenderer.java @@ -31,7 +31,7 @@ public class MechanicalPressRenderer extends KineticTileEntityRenderer { int light, int overlay) { super.renderSafe(te, partialTicks, ms, buffer, light, overlay); - if (Backend.getInstance().canUseInstancing(te.getLevel())) return; + if (Backend.canUseInstancing(te.getLevel())) return; BlockState blockState = te.getBlockState(); float renderedHeadOffset = ((MechanicalPressTileEntity) te).getRenderedHeadOffset(partialTicks); diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/saw/SawRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/components/saw/SawRenderer.java index 149be2e09..5896963ab 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/saw/SawRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/saw/SawRenderer.java @@ -46,8 +46,7 @@ public class SawRenderer extends SafeTileEntityRenderer { renderItems(te, partialTicks, ms, buffer, light, overlay); FilteringRenderer.renderOnTileEntity(te, partialTicks, ms, buffer, light, overlay); - if (Backend.getInstance() - .canUseInstancing(te.getLevel())) + if (Backend.canUseInstancing(te.getLevel())) return; renderShaft(te, ms, buffer, light, overlay); diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/BearingRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/BearingRenderer.java index b3961f558..ed76b3d05 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/BearingRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/BearingRenderer.java @@ -26,7 +26,7 @@ public class BearingRenderer extends KineticTileEntityRenderer { protected void renderSafe(KineticTileEntity te, float partialTicks, PoseStack ms, MultiBufferSource buffer, int light, int overlay) { - if (Backend.getInstance().canUseInstancing(te.getLevel())) return; + if (Backend.canUseInstancing(te.getLevel())) return; super.renderSafe(te, partialTicks, ms, buffer, light, overlay); diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/StabilizedBearingMovementBehaviour.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/StabilizedBearingMovementBehaviour.java index f00e600f3..91735760f 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/StabilizedBearingMovementBehaviour.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/StabilizedBearingMovementBehaviour.java @@ -34,7 +34,7 @@ public class StabilizedBearingMovementBehaviour extends MovementBehaviour { @OnlyIn(Dist.CLIENT) public void renderInContraption(MovementContext context, PlacementSimulationWorld renderWorld, ContraptionMatrices matrices, MultiBufferSource buffer) { - if (Backend.getInstance().canUseInstancing()) return; + if (Backend.isOn()) return; Direction facing = context.state.getValue(BlockStateProperties.FACING); PartialModel top = AllBlockPartials.BEARING_TOP; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/chassis/StickerRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/chassis/StickerRenderer.java index f4c3c8c27..cfb6a1d0e 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/chassis/StickerRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/chassis/StickerRenderer.java @@ -25,7 +25,7 @@ public class StickerRenderer extends SafeTileEntityRenderer { protected void renderSafe(StickerTileEntity te, float partialTicks, PoseStack ms, MultiBufferSource buffer, int light, int overlay) { - if (Backend.getInstance().canUseInstancing(te.getLevel())) return; + if (Backend.canUseInstancing(te.getLevel())) return; BlockState state = te.getBlockState(); SuperByteBuffer head = CachedBufferer.partial(AllBlockPartials.STICKER_HEAD, state); diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/gantry/GantryCarriageRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/gantry/GantryCarriageRenderer.java index 9e52ea3ea..6e3e6fd44 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/gantry/GantryCarriageRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/gantry/GantryCarriageRenderer.java @@ -31,7 +31,7 @@ public class GantryCarriageRenderer extends KineticTileEntityRenderer { int light, int overlay) { super.renderSafe(te, partialTicks, ms, buffer, light, overlay); - if (Backend.getInstance().canUseInstancing(te.getLevel())) return; + if (Backend.canUseInstancing(te.getLevel())) return; BlockState state = te.getBlockState(); Direction facing = state.getValue(GantryCarriageBlock.FACING); diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/pulley/AbstractPulleyRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/pulley/AbstractPulleyRenderer.java index f60c903ab..dfa6dcd0c 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/pulley/AbstractPulleyRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/pulley/AbstractPulleyRenderer.java @@ -44,8 +44,7 @@ public abstract class AbstractPulleyRenderer extends KineticTileEntityRenderer { protected void renderSafe(KineticTileEntity te, float partialTicks, PoseStack ms, MultiBufferSource buffer, int light, int overlay) { - if (Backend.getInstance() - .canUseInstancing(te.getLevel())) + if (Backend.canUseInstancing(te.getLevel())) return; super.renderSafe(te, partialTicks, ms, buffer, light, overlay); diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/ContraptionRenderDispatcher.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/ContraptionRenderDispatcher.java index 59ef2e7eb..c6ae0310d 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/ContraptionRenderDispatcher.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/ContraptionRenderDispatcher.java @@ -178,7 +178,7 @@ public class ContraptionRenderDispatcher { public static void reset() { WORLDS.empty(ContraptionRenderManager::delete); - if (Backend.getInstance().available()) { + if (Backend.isOn()) { WORLDS = new WorldAttached<>(FlwContraptionManager::new); } else { WORLDS = new WorldAttached<>(SBBContraptionManager::new); diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/FlwContraptionManager.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/FlwContraptionManager.java index e6376222b..f2c9c8ee1 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/FlwContraptionManager.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/FlwContraptionManager.java @@ -58,7 +58,7 @@ public class FlwContraptionManager extends ContraptionRenderManager { protected void renderSafe(BeltTileEntity te, float partialTicks, PoseStack ms, MultiBufferSource buffer, int light, int overlay) { - if (!Backend.getInstance().canUseInstancing(te.getLevel())) { + if (!Backend.canUseInstancing(te.getLevel())) { BlockState blockState = te.getBlockState(); if (!AllBlocks.BELT.has(blockState)) return; diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/elementary/BracketedKineticTileInstance.java b/src/main/java/com/simibubi/create/content/contraptions/relays/elementary/BracketedKineticTileInstance.java index 7733d54e7..127addf7f 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/elementary/BracketedKineticTileInstance.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/elementary/BracketedKineticTileInstance.java @@ -2,7 +2,7 @@ package com.simibubi.create.content.contraptions.relays.elementary; import com.jozufozu.flywheel.api.Instancer; import com.jozufozu.flywheel.api.MaterialManager; -import com.jozufozu.flywheel.util.transform.MatrixTransformStack; +import com.jozufozu.flywheel.util.transform.TransformStack; import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.math.Vector3f; import com.simibubi.create.AllBlockPartials; @@ -59,10 +59,11 @@ public class BracketedKineticTileInstance extends SingleRotatingInstance { private PoseStack rotateToAxis(Axis axis) { Direction facing = Direction.fromAxisAndDirection(axis, AxisDirection.POSITIVE); PoseStack poseStack = new PoseStack(); - new MatrixTransformStack(poseStack).centre() - .rotateToFace(facing) - .multiply(Vector3f.XN.rotationDegrees(-90)) - .unCentre(); + TransformStack.cast(poseStack) + .centre() + .rotateToFace(facing) + .multiply(Vector3f.XN.rotationDegrees(-90)) + .unCentre(); return poseStack; } diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/elementary/BracketedKineticTileRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/relays/elementary/BracketedKineticTileRenderer.java index f8f5754a1..8e0e86660 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/elementary/BracketedKineticTileRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/elementary/BracketedKineticTileRenderer.java @@ -28,8 +28,7 @@ public class BracketedKineticTileRenderer extends KineticTileEntityRenderer { protected void renderSafe(KineticTileEntity te, float partialTicks, PoseStack ms, MultiBufferSource buffer, int light, int overlay) { - if (Backend.getInstance() - .canUseInstancing(te.getLevel())) + if (Backend.canUseInstancing(te.getLevel())) return; if (!AllBlocks.LARGE_COGWHEEL.has(te.getBlockState())) { diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/encased/EncasedCogRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/relays/encased/EncasedCogRenderer.java index b7f423b22..12f83e86e 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/encased/EncasedCogRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/encased/EncasedCogRenderer.java @@ -39,8 +39,7 @@ public class EncasedCogRenderer extends KineticTileEntityRenderer { protected void renderSafe(KineticTileEntity te, float partialTicks, PoseStack ms, MultiBufferSource buffer, int light, int overlay) { super.renderSafe(te, partialTicks, ms, buffer, light, overlay); - if (Backend.getInstance() - .canUseInstancing(te.getLevel())) + if (Backend.canUseInstancing(te.getLevel())) return; BlockState blockState = te.getBlockState(); diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/encased/SplitShaftRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/relays/encased/SplitShaftRenderer.java index dd7dce660..ba38d1481 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/encased/SplitShaftRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/encased/SplitShaftRenderer.java @@ -28,7 +28,7 @@ public class SplitShaftRenderer extends KineticTileEntityRenderer { @Override protected void renderSafe(KineticTileEntity te, float partialTicks, PoseStack ms, MultiBufferSource buffer, int light, int overlay) { - if (Backend.getInstance().canUseInstancing(te.getLevel())) return; + if (Backend.canUseInstancing(te.getLevel())) return; Block block = te.getBlockState().getBlock(); final Axis boxAxis = ((IRotate) block).getRotationAxis(te.getBlockState()); diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/gauge/GaugeRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/relays/gauge/GaugeRenderer.java index ce495f0bd..a5872e8b3 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/gauge/GaugeRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/gauge/GaugeRenderer.java @@ -39,7 +39,7 @@ public class GaugeRenderer extends KineticTileEntityRenderer { @Override protected void renderSafe(KineticTileEntity te, float partialTicks, PoseStack ms, MultiBufferSource buffer, int light, int overlay) { - if (Backend.getInstance().canUseInstancing(te.getLevel())) return; + if (Backend.canUseInstancing(te.getLevel())) return; super.renderSafe(te, partialTicks, ms, buffer, light, overlay); diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/gearbox/GearboxRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/relays/gearbox/GearboxRenderer.java index 56194ec81..04671bcad 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/gearbox/GearboxRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/gearbox/GearboxRenderer.java @@ -27,7 +27,7 @@ public class GearboxRenderer extends KineticTileEntityRenderer { @Override protected void renderSafe(KineticTileEntity te, float partialTicks, PoseStack ms, MultiBufferSource buffer, int light, int overlay) { - if (Backend.getInstance().canUseInstancing(te.getLevel())) return; + if (Backend.canUseInstancing(te.getLevel())) return; final Axis boxAxis = te.getBlockState().getValue(BlockStateProperties.AXIS); final BlockPos pos = te.getBlockPos(); diff --git a/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BeltTunnelRenderer.java b/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BeltTunnelRenderer.java index 708853df2..f5f137b2b 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BeltTunnelRenderer.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BeltTunnelRenderer.java @@ -31,7 +31,7 @@ public class BeltTunnelRenderer extends SmartTileEntityRenderer { int light, int overlay) { super.renderSafe(te, partialTicks, ms, buffer, light, overlay); - if (!te.hasFlap() || Backend.getInstance().canUseInstancing(te.getLevel())) + if (!te.hasFlap() || Backend.canUseInstancing(te.getLevel())) return; BlockState blockState = te.getBlockState(); diff --git a/src/main/java/com/simibubi/create/content/logistics/block/mechanicalArm/ArmRenderer.java b/src/main/java/com/simibubi/create/content/logistics/block/mechanicalArm/ArmRenderer.java index aa513be83..42fb0e55f 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/mechanicalArm/ArmRenderer.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/mechanicalArm/ArmRenderer.java @@ -44,7 +44,7 @@ public class ArmRenderer extends KineticTileEntityRenderer { ArmTileEntity arm = (ArmTileEntity) te; ItemStack item = arm.heldItem; boolean hasItem = !item.isEmpty(); - boolean usingFlywheel = Backend.getInstance().canUseInstancing(te.getLevel()); + boolean usingFlywheel = Backend.canUseInstancing(te.getLevel()); if (usingFlywheel && !hasItem) return; diff --git a/src/main/java/com/simibubi/create/content/logistics/block/redstone/AnalogLeverRenderer.java b/src/main/java/com/simibubi/create/content/logistics/block/redstone/AnalogLeverRenderer.java index 481e3dda7..2d6026c16 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/redstone/AnalogLeverRenderer.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/redstone/AnalogLeverRenderer.java @@ -26,7 +26,7 @@ public class AnalogLeverRenderer extends SafeTileEntityRenderer iterator = customRenderTEs.iterator(); while (iterator.hasNext()) { BlockEntity tileEntity = iterator.next(); - if (Backend.getInstance().canUseInstancing(renderWorld) && InstancedRenderRegistry.getInstance() + if (Backend.canUseInstancing(renderWorld) && InstancedRenderRegistry.getInstance() .shouldSkipRender(tileEntity)) continue; BlockEntityRenderer renderer = Minecraft.getInstance().getBlockEntityRenderDispatcher().getRenderer(tileEntity); diff --git a/src/main/java/com/simibubi/create/foundation/tileEntity/renderer/ColoredOverlayTileEntityRenderer.java b/src/main/java/com/simibubi/create/foundation/tileEntity/renderer/ColoredOverlayTileEntityRenderer.java index 310bbeb6e..8ba1894ac 100644 --- a/src/main/java/com/simibubi/create/foundation/tileEntity/renderer/ColoredOverlayTileEntityRenderer.java +++ b/src/main/java/com/simibubi/create/foundation/tileEntity/renderer/ColoredOverlayTileEntityRenderer.java @@ -18,7 +18,7 @@ public abstract class ColoredOverlayTileEntityRenderer ex protected void renderSafe(T te, float partialTicks, PoseStack ms, MultiBufferSource buffer, int light, int overlay) { - if (Backend.getInstance().canUseInstancing(te.getLevel())) return; + if (Backend.canUseInstancing(te.getLevel())) return; SuperByteBuffer render = render(getOverlayBuffer(te), getColor(te, partialTicks), light); render.renderInto(ms, buffer.getBuffer(RenderType.solid()));