From 4190ac72c5b6cc1303a4c4c93823cb1de43f791e Mon Sep 17 00:00:00 2001 From: IThundxr Date: Fri, 7 Jun 2024 16:00:21 -0400 Subject: [PATCH] fix issues here and there --- .../dev/engine_room/gradle/subproject/SubprojectPlugin.kt | 6 ++---- .../java/dev/engine_room/flywheel/impl/FlwCommands.java | 6 ++++-- .../java/dev/engine_room/flywheel/impl/FlywheelForge.java | 8 ++++---- .../engine_room/flywheel/impl/mixin/MinecraftMixin.java | 2 +- .../flywheel/impl/mixin/sodium/SodiumMixinPlugin.java | 2 +- forge/src/main/resources/META-INF/mods.toml | 8 -------- 6 files changed, 12 insertions(+), 20 deletions(-) diff --git a/buildSrc/src/main/kotlin/dev/engine_room/gradle/subproject/SubprojectPlugin.kt b/buildSrc/src/main/kotlin/dev/engine_room/gradle/subproject/SubprojectPlugin.kt index 8398fa57e..e0c8ea1f1 100644 --- a/buildSrc/src/main/kotlin/dev/engine_room/gradle/subproject/SubprojectPlugin.kt +++ b/buildSrc/src/main/kotlin/dev/engine_room/gradle/subproject/SubprojectPlugin.kt @@ -48,14 +48,12 @@ class SubprojectPlugin: Plugin { } } - @Suppress("UnstableApiUsage") private fun setupLoom(project: Project) { val loom = project.the() loom.silentMojangMappingsLicense() - // FIXME y tho? :( - loom.mixin.useLegacyMixinAp = true - loom.mixin.defaultRefmapName = "flywheel.refmap.json" + //fixme is this still needed? +// loom.mixin.defaultRefmapName = "flywheel.refmap.json" } private fun setupJava(project: Project) { diff --git a/forge/src/main/java/dev/engine_room/flywheel/impl/FlwCommands.java b/forge/src/main/java/dev/engine_room/flywheel/impl/FlwCommands.java index 830c0fb0f..a9bf69df4 100644 --- a/forge/src/main/java/dev/engine_room/flywheel/impl/FlwCommands.java +++ b/forge/src/main/java/dev/engine_room/flywheel/impl/FlwCommands.java @@ -17,6 +17,8 @@ import net.minecraft.network.chat.Component; import net.minecraft.world.entity.Entity; import net.neoforged.neoforge.client.event.RegisterClientCommandsEvent; import net.neoforged.neoforge.common.ModConfigSpec; +import net.neoforged.neoforge.common.ModConfigSpec.BooleanValue; +import net.neoforged.neoforge.common.ModConfigSpec.ConfigValue; public final class FlwCommands { private FlwCommands() { @@ -25,7 +27,7 @@ public final class FlwCommands { public static void registerClientCommands(RegisterClientCommandsEvent event) { LiteralArgumentBuilder command = Commands.literal("flywheel"); - ModConfigSpec.ConfigValue backendValue = ForgeFlwConfig.INSTANCE.client.backend; + ConfigValue backendValue = ForgeFlwConfig.INSTANCE.client.backend; command.then(Commands.literal("backend") .executes(context -> { Backend backend = BackendManager.getBackend(); @@ -55,7 +57,7 @@ public final class FlwCommands { return Command.SINGLE_SUCCESS; }))); - ModConfigSpec.BooleanValue limitUpdatesValue = ForgeFlwConfig.INSTANCE.client.limitUpdates; + BooleanValue limitUpdatesValue = ForgeFlwConfig.INSTANCE.client.limitUpdates; command.then(Commands.literal("limitUpdates") .executes(context -> { if (limitUpdatesValue.get()) { 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 c0892ed56..cc1c871a3 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 @@ -6,6 +6,7 @@ import net.neoforged.bus.api.IEventBus; import net.neoforged.fml.CrashReportCallables; import net.neoforged.fml.DistExecutor; import net.neoforged.fml.LogicalSide; +import net.neoforged.fml.ModContainer; import net.neoforged.fml.ModLoadingContext; import net.neoforged.fml.common.Mod; @@ -47,11 +48,10 @@ public final class FlywheelForge { @UnknownNullability private static ArtifactVersion version; - public FlywheelForge(IEventBus modEventBus) { + public FlywheelForge(IEventBus modEventBus, ModContainer modContainer) { ModLoadingContext modLoadingContext = ModLoadingContext.get(); - version = modLoadingContext - .getActiveContainer() + version = modContainer .getModInfo() .getVersion(); @@ -97,7 +97,7 @@ public final class FlywheelForge { FlwDebugInfo.addDebugInfo(minecraft, e.getRight()); }); - modEventBus.addListener((EndClientResourceReloadEvent e) -> BackendManagerImpl.onEndClientResourceReload(e.error() != null)); + modEventBus.addListener((EndClientResourceReloadEvent e) -> BackendManagerImpl.onEndClientResourceReload(e.error().isPresent())); modEventBus.addListener((FMLCommonSetupEvent e) -> { ArgumentTypeInfos.registerByClass(BackendArgument.class, BackendArgument.INFO); diff --git a/forge/src/main/java/dev/engine_room/flywheel/impl/mixin/MinecraftMixin.java b/forge/src/main/java/dev/engine_room/flywheel/impl/mixin/MinecraftMixin.java index 2305ba681..282e0f7e6 100644 --- a/forge/src/main/java/dev/engine_room/flywheel/impl/mixin/MinecraftMixin.java +++ b/forge/src/main/java/dev/engine_room/flywheel/impl/mixin/MinecraftMixin.java @@ -22,7 +22,7 @@ import dev.engine_room.flywheel.impl.FlwImpl; import net.minecraft.client.Minecraft; import net.minecraft.server.packs.resources.ReloadableResourceManager; -@Mixin(value = Minecraft.class, remap = false) +@Mixin(Minecraft.class) abstract class MinecraftMixin { @Shadow @Final diff --git a/forge/src/main/java/dev/engine_room/flywheel/impl/mixin/sodium/SodiumMixinPlugin.java b/forge/src/main/java/dev/engine_room/flywheel/impl/mixin/sodium/SodiumMixinPlugin.java index 5ee303ff0..d5dda574a 100644 --- a/forge/src/main/java/dev/engine_room/flywheel/impl/mixin/sodium/SodiumMixinPlugin.java +++ b/forge/src/main/java/dev/engine_room/flywheel/impl/mixin/sodium/SodiumMixinPlugin.java @@ -13,7 +13,7 @@ import org.spongepowered.asm.mixin.extensibility.IMixinInfo; import com.google.common.base.Suppliers; public class SodiumMixinPlugin implements IMixinConfigPlugin { - private static final Supplier IS_SODIUM_LOADED = Suppliers.memoize(() -> LoadingModList.get().getModFileById("rubidium") != null); + private static final Supplier IS_SODIUM_LOADED = Suppliers.memoize(() -> LoadingModList.get().getModFileById("embeddium") != null); @Override public void onLoad(String mixinPackage) { diff --git a/forge/src/main/resources/META-INF/mods.toml b/forge/src/main/resources/META-INF/mods.toml index 546372adf..0fe5ee7c5 100644 --- a/forge/src/main/resources/META-INF/mods.toml +++ b/forge/src/main/resources/META-INF/mods.toml @@ -32,11 +32,3 @@ modId = "neoforge" type = "required" versionRange = "${neoforge_version_range}" side = "CLIENT" - -# Breaks dependency -[[dependencies.${mod_id}]] -modId = "rubidium" -type = "incompatible" -reason = "mixin crash with any version of rubidium under 0.7.0" -versionRange = "[0.7.0,)" -side = "CLIENT"