From 3d8fdc69de654a58f3cc8d4fd79dc70ed7576337 Mon Sep 17 00:00:00 2001 From: Jozufozu Date: Mon, 20 Jun 2022 09:23:54 -0700 Subject: [PATCH] A little back and forth - Clean up the revert --- gradle.properties | 2 +- .../components/actors/DrillMovementBehaviour.java | 5 ++--- .../components/actors/HarvesterMovementBehaviour.java | 5 ++--- .../actors/PortableStorageInterfaceMovement.java | 5 ++--- .../components/deployer/DeployerMovementBehaviour.java | 4 ++-- .../bearing/StabilizedBearingMovementBehaviour.java | 4 +--- .../render/ContraptionRenderDispatcher.java | 6 +++++- .../structureMovement/render/FlwContraption.java | 9 ++------- .../structureMovement/render/FlwContraptionManager.java | 8 ++++---- 9 files changed, 21 insertions(+), 27 deletions(-) diff --git a/gradle.properties b/gradle.properties index 4ed16e108..bd8bf3487 100644 --- a/gradle.properties +++ b/gradle.properties @@ -19,7 +19,7 @@ parchment_version = 2022.03.13 # dependency versions registrate_version = MC1.18.2-1.0.25 -flywheel_version = 1.18-0.6.2.64 +flywheel_version = 1.18-0.6.2.66 jei_minecraft_version = 1.18.2 jei_version = 9.5.3.143 curios_minecraft_version = 1.18.2 diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/actors/DrillMovementBehaviour.java b/src/main/java/com/simibubi/create/content/contraptions/components/actors/DrillMovementBehaviour.java index 7becc131c..89ebb9582 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/actors/DrillMovementBehaviour.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/actors/DrillMovementBehaviour.java @@ -3,13 +3,12 @@ package com.simibubi.create.content.contraptions.components.actors; import javax.annotation.Nullable; import com.jozufozu.flywheel.api.MaterialManager; -import com.jozufozu.flywheel.backend.Backend; import com.jozufozu.flywheel.core.virtual.VirtualRenderWorld; import com.simibubi.create.AllBlocks; import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext; import com.simibubi.create.content.contraptions.components.structureMovement.render.ActorInstance; import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionMatrices; -import com.simibubi.create.content.contraptions.components.structureMovement.render.FlwContraption; +import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionRenderDispatcher; import com.simibubi.create.foundation.utility.VecHelper; import net.minecraft.client.renderer.MultiBufferSource; @@ -39,7 +38,7 @@ public class DrillMovementBehaviour extends BlockBreakingMovementBehaviour { @OnlyIn(value = Dist.CLIENT) public void renderInContraption(MovementContext context, VirtualRenderWorld renderWorld, ContraptionMatrices matrices, MultiBufferSource buffer) { - if (!FlwContraption.canInstance()) + if (!ContraptionRenderDispatcher.canInstance()) DrillRenderer.renderInContraption(context, renderWorld, matrices, buffer); } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/actors/HarvesterMovementBehaviour.java b/src/main/java/com/simibubi/create/content/contraptions/components/actors/HarvesterMovementBehaviour.java index 702c804c0..9360166dc 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/actors/HarvesterMovementBehaviour.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/actors/HarvesterMovementBehaviour.java @@ -5,13 +5,12 @@ import javax.annotation.Nullable; import org.apache.commons.lang3.mutable.MutableBoolean; import com.jozufozu.flywheel.api.MaterialManager; -import com.jozufozu.flywheel.backend.Backend; import com.jozufozu.flywheel.core.virtual.VirtualRenderWorld; import com.simibubi.create.content.contraptions.components.structureMovement.MovementBehaviour; import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext; import com.simibubi.create.content.contraptions.components.structureMovement.render.ActorInstance; import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionMatrices; -import com.simibubi.create.content.contraptions.components.structureMovement.render.FlwContraption; +import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionRenderDispatcher; import com.simibubi.create.foundation.config.AllConfigs; import com.simibubi.create.foundation.utility.BlockHelper; import com.simibubi.create.foundation.utility.VecHelper; @@ -59,7 +58,7 @@ public class HarvesterMovementBehaviour implements MovementBehaviour { @Override public void renderInContraption(MovementContext context, VirtualRenderWorld renderWorld, ContraptionMatrices matrices, MultiBufferSource buffers) { - if (!FlwContraption.canInstance()) + if (!ContraptionRenderDispatcher.canInstance()) HarvesterRenderer.renderInContraption(context, renderWorld, matrices, buffers); } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/actors/PortableStorageInterfaceMovement.java b/src/main/java/com/simibubi/create/content/contraptions/components/actors/PortableStorageInterfaceMovement.java index a6f155b2a..6df522cf8 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/actors/PortableStorageInterfaceMovement.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/actors/PortableStorageInterfaceMovement.java @@ -5,13 +5,12 @@ import java.util.Optional; import org.jetbrains.annotations.Nullable; import com.jozufozu.flywheel.api.MaterialManager; -import com.jozufozu.flywheel.backend.Backend; import com.jozufozu.flywheel.core.virtual.VirtualRenderWorld; import com.simibubi.create.content.contraptions.components.structureMovement.MovementBehaviour; import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext; import com.simibubi.create.content.contraptions.components.structureMovement.render.ActorInstance; import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionMatrices; -import com.simibubi.create.content.contraptions.components.structureMovement.render.FlwContraption; +import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionRenderDispatcher; import com.simibubi.create.content.logistics.trains.entity.CarriageContraption; import com.simibubi.create.foundation.utility.VecHelper; import com.simibubi.create.foundation.utility.animation.LerpedFloat; @@ -56,7 +55,7 @@ public class PortableStorageInterfaceMovement implements MovementBehaviour { @OnlyIn(Dist.CLIENT) public void renderInContraption(MovementContext context, VirtualRenderWorld renderWorld, ContraptionMatrices matrices, MultiBufferSource buffer) { - if (!FlwContraption.canInstance()) + if (!ContraptionRenderDispatcher.canInstance()) PortableStorageInterfaceRenderer.renderInContraption(context, renderWorld, matrices, buffer); } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerMovementBehaviour.java b/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerMovementBehaviour.java index b3e05b4d6..0fb1332dc 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerMovementBehaviour.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerMovementBehaviour.java @@ -20,7 +20,7 @@ import com.simibubi.create.content.contraptions.components.structureMovement.Ori import com.simibubi.create.content.contraptions.components.structureMovement.mounted.MountedContraption; import com.simibubi.create.content.contraptions.components.structureMovement.render.ActorInstance; import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionMatrices; -import com.simibubi.create.content.contraptions.components.structureMovement.render.FlwContraption; +import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionRenderDispatcher; import com.simibubi.create.content.logistics.item.filter.FilterItem; import com.simibubi.create.content.logistics.trains.entity.CarriageContraption; import com.simibubi.create.content.logistics.trains.entity.CarriageContraptionEntity; @@ -298,7 +298,7 @@ public class DeployerMovementBehaviour implements MovementBehaviour { @Override public void renderInContraption(MovementContext context, VirtualRenderWorld renderWorld, ContraptionMatrices matrices, MultiBufferSource buffers) { - if (!FlwContraption.canInstance()) + if (!ContraptionRenderDispatcher.canInstance()) DeployerRenderer.renderInContraption(context, renderWorld, matrices, buffers); } 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 dd8792dd3..340db86f8 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 @@ -3,7 +3,6 @@ package com.simibubi.create.content.contraptions.components.structureMovement.be import javax.annotation.Nullable; import com.jozufozu.flywheel.api.MaterialManager; -import com.jozufozu.flywheel.backend.Backend; import com.jozufozu.flywheel.core.PartialModel; import com.jozufozu.flywheel.core.virtual.VirtualRenderWorld; import com.mojang.math.Quaternion; @@ -16,7 +15,6 @@ import com.simibubi.create.content.contraptions.components.structureMovement.Ori import com.simibubi.create.content.contraptions.components.structureMovement.render.ActorInstance; import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionMatrices; import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionRenderDispatcher; -import com.simibubi.create.content.contraptions.components.structureMovement.render.FlwContraption; import com.simibubi.create.foundation.render.CachedBufferer; import com.simibubi.create.foundation.render.SuperByteBuffer; import com.simibubi.create.foundation.utility.AnimationTickHolder; @@ -35,7 +33,7 @@ public class StabilizedBearingMovementBehaviour implements MovementBehaviour { @OnlyIn(Dist.CLIENT) public void renderInContraption(MovementContext context, VirtualRenderWorld renderWorld, ContraptionMatrices matrices, MultiBufferSource buffer) { - if (FlwContraption.canInstance()) + if (ContraptionRenderDispatcher.canInstance()) return; Direction facing = context.state.getValue(BlockStateProperties.FACING); 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 5fb4abd97..cbbf6db71 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 @@ -123,7 +123,7 @@ public class ContraptionRenderDispatcher { VirtualRenderWorld renderWorld = new VirtualRenderWorld(world, origin, height, minBuildHeight) { @Override public boolean supportsFlywheel() { - return Backend.getBackendType() == BackendType.INSTANCING; + return canInstance(); } }; @@ -204,4 +204,8 @@ public class ContraptionRenderDispatcher { WORLDS = new WorldAttached<>(SBBContraptionManager::new); } } + + public static boolean canInstance() { + return Backend.getBackendType() == BackendType.INSTANCING; + } } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/FlwContraption.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/FlwContraption.java index 4694d9990..abc7b2c90 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/FlwContraption.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/FlwContraption.java @@ -13,7 +13,6 @@ import com.jozufozu.flywheel.backend.instancing.SerialTaskEngine; import com.jozufozu.flywheel.backend.instancing.batching.BatchingEngine; import com.jozufozu.flywheel.backend.instancing.instancing.InstancingEngine; import com.jozufozu.flywheel.backend.model.ArrayModelRenderer; -import com.jozufozu.flywheel.config.BackendType; import com.jozufozu.flywheel.core.model.Model; import com.jozufozu.flywheel.core.model.WorldModel; import com.jozufozu.flywheel.core.virtual.VirtualRenderWorld; @@ -54,17 +53,13 @@ public class FlwContraption extends ContraptionRenderInfo { var restoreState = GlStateTracker.getRestoreState(); buildLayers(); - if (canInstance()) { + if (ContraptionRenderDispatcher.canInstance()) { buildInstancedTiles(); buildActors(); } restoreState.restore(); } - public static boolean canInstance() { - return Backend.getBackendType() == BackendType.INSTANCING; - } - public ContraptionLighter getLighter() { return lighter; } @@ -186,7 +181,7 @@ public class FlwContraption extends ContraptionRenderInfo { private final ContraptionInstanceManager tileInstanceManager; public ContraptionInstanceWorld(FlwContraption parent) { - switch (Backend.getEngine()) { + switch (Backend.getBackendType()) { case INSTANCING -> { InstancingEngine engine = InstancingEngine.builder(CreateContexts.CWORLD) .setGroupFactory(ContraptionGroup.forContraption(parent)) 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 5911a9025..3c44caea7 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 @@ -7,7 +7,7 @@ import com.jozufozu.flywheel.backend.Backend; import com.jozufozu.flywheel.backend.RenderLayer; import com.jozufozu.flywheel.backend.gl.GlStateTracker; import com.jozufozu.flywheel.backend.gl.GlTextureUnit; -import com.jozufozu.flywheel.config.FlwEngine; +import com.jozufozu.flywheel.config.BackendType; import com.jozufozu.flywheel.core.Formats; import com.jozufozu.flywheel.core.Materials; import com.jozufozu.flywheel.core.compile.ProgramContext; @@ -43,12 +43,12 @@ public class FlwContraptionManager extends ContraptionRenderingWorld