From 95758d025e8c22810e439b9e5c73db76200bea8e Mon Sep 17 00:00:00 2001 From: IThundxr Date: Sat, 12 Oct 2024 19:55:22 -0400 Subject: [PATCH] address reviews --- .../dev/engine_room/flywheel/impl/compat/SodiumCompat.java | 2 +- .../flywheel/impl/mixin/BlockEntityTypeMixin.java | 2 +- .../engine_room/flywheel/impl/mixin/EntityTypeMixin.java | 1 + .../java/dev/engine_room/flywheel/impl/FlywheelForge.java | 7 ++++--- forge/src/main/resources/META-INF/mods.toml | 2 +- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/common/src/main/java/dev/engine_room/flywheel/impl/compat/SodiumCompat.java b/common/src/main/java/dev/engine_room/flywheel/impl/compat/SodiumCompat.java index 7b39a062b..609b0d4b2 100644 --- a/common/src/main/java/dev/engine_room/flywheel/impl/compat/SodiumCompat.java +++ b/common/src/main/java/dev/engine_room/flywheel/impl/compat/SodiumCompat.java @@ -7,7 +7,7 @@ import net.minecraft.world.level.block.entity.BlockEntityType; public class SodiumCompat { - public static Object forBlockEntityType(BlockEntityType type) { + public static Object addPredicate(BlockEntityType type) { BlockEntityRenderPredicate predicate = (getter, pos, be) -> VisualizationHelper.tryAddBlockEntity(be); BlockEntityRenderHandler.instance().addRenderPredicate(type, predicate); return predicate; diff --git a/common/src/main/java/dev/engine_room/flywheel/impl/mixin/BlockEntityTypeMixin.java b/common/src/main/java/dev/engine_room/flywheel/impl/mixin/BlockEntityTypeMixin.java index ab9ef91f2..b2e75dac9 100644 --- a/common/src/main/java/dev/engine_room/flywheel/impl/mixin/BlockEntityTypeMixin.java +++ b/common/src/main/java/dev/engine_room/flywheel/impl/mixin/BlockEntityTypeMixin.java @@ -31,7 +31,7 @@ abstract class BlockEntityTypeMixin implements BlockEntit public void flywheel$setVisualizer(@Nullable BlockEntityVisualizer visualizer) { if (CompatMods.SODIUM.isLoaded() && !CompatMods.EMBEDDIUM.isLoaded()) { if (flywheel$visualizer == null && visualizer != null) { - flywheel$sodiumPredicate = SodiumCompat.forBlockEntityType((BlockEntityType) (Object) this); + flywheel$sodiumPredicate = SodiumCompat.addPredicate((BlockEntityType) (Object) this); } else if (flywheel$visualizer != null && visualizer == null && flywheel$sodiumPredicate != null) { SodiumCompat.removePredicate((BlockEntityType) (Object) this, flywheel$sodiumPredicate); } diff --git a/common/src/main/java/dev/engine_room/flywheel/impl/mixin/EntityTypeMixin.java b/common/src/main/java/dev/engine_room/flywheel/impl/mixin/EntityTypeMixin.java index e8b605a32..9584a1493 100644 --- a/common/src/main/java/dev/engine_room/flywheel/impl/mixin/EntityTypeMixin.java +++ b/common/src/main/java/dev/engine_room/flywheel/impl/mixin/EntityTypeMixin.java @@ -12,6 +12,7 @@ @Mixin(EntityType.class) abstract class EntityTypeMixin implements EntityTypeExtension { @Unique + @Nullable private EntityVisualizer flywheel$visualizer; @Override diff --git a/forge/src/main/java/dev/engine_room/flywheel/impl/FlywheelForge.java b/forge/src/main/java/dev/engine_room/flywheel/impl/FlywheelForge.java index 5e9918914..760971417 100644 --- a/forge/src/main/java/dev/engine_room/flywheel/impl/FlywheelForge.java +++ b/forge/src/main/java/dev/engine_room/flywheel/impl/FlywheelForge.java @@ -1,7 +1,5 @@ package dev.engine_room.flywheel.impl; -import dev.engine_room.flywheel.impl.compat.CompatMods; -import dev.engine_room.flywheel.impl.compat.EmbeddiumCompat; import org.apache.maven.artifact.versioning.ArtifactVersion; import org.jetbrains.annotations.UnknownNullability; @@ -10,6 +8,8 @@ import dev.engine_room.flywheel.api.event.ReloadLevelRendererEvent; import dev.engine_room.flywheel.backend.compile.FlwProgramsReloader; import dev.engine_room.flywheel.backend.engine.uniform.Uniforms; +import dev.engine_room.flywheel.impl.compat.CompatMods; +import dev.engine_room.flywheel.impl.compat.EmbeddiumCompat; import dev.engine_room.flywheel.impl.visualization.VisualizationEventHandler; import dev.engine_room.flywheel.lib.model.baked.PartialModelEventHandler; import dev.engine_room.flywheel.lib.util.LevelAttached; @@ -66,8 +66,9 @@ private static void clientInit(IEventBus forgeEventBus, IEventBus modEventBus) { CrashReportCallables.registerCrashCallable("Flywheel Backend", BackendManagerImpl::getBackendString); FlwImpl.init(); - if (CompatMods.EMBEDDIUM.isLoaded()) + if (CompatMods.EMBEDDIUM.isLoaded()) { EmbeddiumCompat.init(); + } } private static void registerImplEventListeners(IEventBus forgeEventBus, IEventBus modEventBus) { diff --git a/forge/src/main/resources/META-INF/mods.toml b/forge/src/main/resources/META-INF/mods.toml index e4adfa7ce..a4d4526ab 100644 --- a/forge/src/main/resources/META-INF/mods.toml +++ b/forge/src/main/resources/META-INF/mods.toml @@ -26,7 +26,7 @@ mandatory = true versionRange = "${forge_version_range}" side = "CLIENT" -[[dependencies.flywheel]] +[[dependencies.${mod_id}]] modId = "embeddium" mandatory = false versionRange = "[0.3.25,)"