From ad938399b4f6ea0f976a98c6cc668a2b8de655aa Mon Sep 17 00:00:00 2001 From: IThundxr Date: Tue, 29 Oct 2024 17:48:20 -0400 Subject: [PATCH] post merge fixes --- .../flywheel/impl/compat/CompatMods.java | 2 +- .../flywheel/impl/FlwImplXplatImpl.java | 4 ++- .../flywheel/impl/FlwLibXplatImpl.java | 25 -------------- .../flywheel/impl/FlwImplXplatImpl.java | 1 - .../flywheel/impl/FlwLibXplatImpl.java | 25 -------------- .../flywheel/impl/compat/EmbeddiumCompat.java | 33 ------------------- 6 files changed, 4 insertions(+), 86 deletions(-) delete mode 100644 forge/src/main/java/dev/engine_room/flywheel/impl/compat/EmbeddiumCompat.java diff --git a/common/src/main/java/dev/engine_room/flywheel/impl/compat/CompatMods.java b/common/src/main/java/dev/engine_room/flywheel/impl/compat/CompatMods.java index 414f69448..756360d01 100644 --- a/common/src/main/java/dev/engine_room/flywheel/impl/compat/CompatMods.java +++ b/common/src/main/java/dev/engine_room/flywheel/impl/compat/CompatMods.java @@ -9,6 +9,6 @@ public enum CompatMods { public final boolean isLoaded; CompatMods(String modId) { - isLoaded = FlwImplXplat.INSTANCE.getModLoaded(modId); + isLoaded = FlwImplXplat.INSTANCE.isModLoaded(modId); } } diff --git a/fabric/src/main/java/dev/engine_room/flywheel/impl/FlwImplXplatImpl.java b/fabric/src/main/java/dev/engine_room/flywheel/impl/FlwImplXplatImpl.java index 7a2c9df22..8c2f7069d 100644 --- a/fabric/src/main/java/dev/engine_room/flywheel/impl/FlwImplXplatImpl.java +++ b/fabric/src/main/java/dev/engine_room/flywheel/impl/FlwImplXplatImpl.java @@ -1,6 +1,8 @@ package dev.engine_room.flywheel.impl; import dev.engine_room.flywheel.api.event.ReloadLevelRendererCallback; +import dev.engine_room.flywheel.impl.compat.CompatMods; +import dev.engine_room.flywheel.impl.compat.FabricSodiumCompat; import net.fabricmc.loader.api.FabricLoader; import net.minecraft.client.multiplayer.ClientLevel; @@ -32,6 +34,6 @@ public boolean useSodium0_6Compat() { @Override public boolean useIrisCompat() { - return CompatMod.IRIS.isLoaded; + return CompatMods.IRIS.isLoaded; } } diff --git a/fabric/src/main/java/dev/engine_room/flywheel/impl/FlwLibXplatImpl.java b/fabric/src/main/java/dev/engine_room/flywheel/impl/FlwLibXplatImpl.java index def03542e..13b13505a 100644 --- a/fabric/src/main/java/dev/engine_room/flywheel/impl/FlwLibXplatImpl.java +++ b/fabric/src/main/java/dev/engine_room/flywheel/impl/FlwLibXplatImpl.java @@ -2,7 +2,6 @@ import org.jetbrains.annotations.UnknownNullability; -import dev.engine_room.flywheel.impl.compat.CompatMods; import dev.engine_room.flywheel.lib.internal.FlwLibXplat; import dev.engine_room.flywheel.lib.model.baked.BakedModelBuilder; import dev.engine_room.flywheel.lib.model.baked.BlockModelBuilder; @@ -10,8 +9,6 @@ import dev.engine_room.flywheel.lib.model.baked.FabricBlockModelBuilder; import dev.engine_room.flywheel.lib.model.baked.FabricMultiBlockModelBuilder; import dev.engine_room.flywheel.lib.model.baked.MultiBlockModelBuilder; -import dev.engine_room.flywheel.lib.util.ShadersModHandler; -import net.irisshaders.iris.api.v0.IrisApi; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.block.BlockRenderDispatcher; import net.minecraft.client.resources.model.BakedModel; @@ -47,26 +44,4 @@ public BlockModelBuilder createBlockModelBuilder(BlockState state) { public MultiBlockModelBuilder createMultiBlockModelBuilder(BlockAndTintGetter level, Iterable positions) { return new FabricMultiBlockModelBuilder(level, positions); } - - @Override - @Nullable - public ShadersModHandler.InternalHandler createIrisHandler() { - if (!CompatMods.IRIS.isLoaded) { - return null; - } - - return new ShadersModHandler.InternalHandler() { - @Override - public boolean isShaderPackInUse() { - return IrisApi.getInstance() - .isShaderPackInUse(); - } - - @Override - public boolean isRenderingShadowPass() { - return IrisApi.getInstance() - .isRenderingShadowPass(); - } - }; - } } diff --git a/forge/src/main/java/dev/engine_room/flywheel/impl/FlwImplXplatImpl.java b/forge/src/main/java/dev/engine_room/flywheel/impl/FlwImplXplatImpl.java index 4e3b1d069..d27e2bb0b 100644 --- a/forge/src/main/java/dev/engine_room/flywheel/impl/FlwImplXplatImpl.java +++ b/forge/src/main/java/dev/engine_room/flywheel/impl/FlwImplXplatImpl.java @@ -5,7 +5,6 @@ import net.minecraft.client.multiplayer.ClientLevel; import net.neoforged.fml.loading.LoadingModList; import net.neoforged.neoforge.common.NeoForge; -import net.minecraftforge.fml.loading.LoadingModList; public class FlwImplXplatImpl implements FlwImplXplat { @Override diff --git a/forge/src/main/java/dev/engine_room/flywheel/impl/FlwLibXplatImpl.java b/forge/src/main/java/dev/engine_room/flywheel/impl/FlwLibXplatImpl.java index 3590aea70..58e135b6e 100644 --- a/forge/src/main/java/dev/engine_room/flywheel/impl/FlwLibXplatImpl.java +++ b/forge/src/main/java/dev/engine_room/flywheel/impl/FlwLibXplatImpl.java @@ -4,7 +4,6 @@ import org.jetbrains.annotations.UnknownNullability; -import dev.engine_room.flywheel.impl.compat.CompatMods; import dev.engine_room.flywheel.lib.internal.FlwLibXplat; import dev.engine_room.flywheel.lib.model.baked.BakedModelBuilder; import dev.engine_room.flywheel.lib.model.baked.BlockModelBuilder; @@ -12,8 +11,6 @@ import dev.engine_room.flywheel.lib.model.baked.NeoForgeBakedModelBuilder; import dev.engine_room.flywheel.lib.model.baked.NeoForgeBlockModelBuilder; import dev.engine_room.flywheel.lib.model.baked.NeoForgeMultiBlockModelBuilder; -import dev.engine_room.flywheel.lib.util.ShadersModHandler; -import net.irisshaders.iris.api.v0.IrisApi; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.block.BlockRenderDispatcher; import net.minecraft.client.renderer.block.ModelBlockRenderer; @@ -64,26 +61,4 @@ public BlockModelBuilder createBlockModelBuilder(BlockState state) { public MultiBlockModelBuilder createMultiBlockModelBuilder(BlockAndTintGetter level, Iterable positions) { return new NeoForgeMultiBlockModelBuilder(level, positions); } - - @Override - @Nullable - public ShadersModHandler.InternalHandler createIrisHandler() { - if (!CompatMods.IRIS.isLoaded) { - return null; - } - - return new ShadersModHandler.InternalHandler() { - @Override - public boolean isShaderPackInUse() { - return IrisApi.getInstance() - .isShaderPackInUse(); - } - - @Override - public boolean isRenderingShadowPass() { - return IrisApi.getInstance() - .isRenderingShadowPass(); - } - }; - } } diff --git a/forge/src/main/java/dev/engine_room/flywheel/impl/compat/EmbeddiumCompat.java b/forge/src/main/java/dev/engine_room/flywheel/impl/compat/EmbeddiumCompat.java deleted file mode 100644 index cd1e5e138..000000000 --- a/forge/src/main/java/dev/engine_room/flywheel/impl/compat/EmbeddiumCompat.java +++ /dev/null @@ -1,33 +0,0 @@ -package dev.engine_room.flywheel.impl.compat; - -import org.embeddedt.embeddium.api.ChunkDataBuiltEvent; - -import dev.engine_room.flywheel.impl.FlwImpl; -import dev.engine_room.flywheel.lib.visualization.VisualizationHelper; - -public final class EmbeddiumCompat { - public static final boolean ACTIVE = CompatMod.EMBEDDIUM.isLoaded; - - static { - if (ACTIVE) { - FlwImpl.LOGGER.debug("Detected Embeddium"); - } - } - - private EmbeddiumCompat() { - } - - public static void init() { - if (ACTIVE) { - Internals.init(); - } - } - - private static final class Internals { - static void init() { - ChunkDataBuiltEvent.BUS.addListener(event -> { - event.getDataBuilder().removeBlockEntitiesIf(VisualizationHelper::tryAddBlockEntity); - }); - } - } -}