Skip to content

Commit

Permalink
fix issues here and there
Browse files Browse the repository at this point in the history
  • Loading branch information
IThundxr committed Jun 7, 2024
1 parent 25a5522 commit 4190ac7
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,12 @@ class SubprojectPlugin: Plugin<Project> {
}
}

@Suppress("UnstableApiUsage")
private fun setupLoom(project: Project) {
val loom = project.the<LoomGradleExtensionAPI>()
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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
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() {
Expand All @@ -25,7 +27,7 @@ private FlwCommands() {
public static void registerClientCommands(RegisterClientCommandsEvent event) {
LiteralArgumentBuilder<CommandSourceStack> command = Commands.literal("flywheel");

ModConfigSpec.ConfigValue<String> backendValue = ForgeFlwConfig.INSTANCE.client.backend;
ConfigValue<String> backendValue = ForgeFlwConfig.INSTANCE.client.backend;
command.then(Commands.literal("backend")
.executes(context -> {
Backend backend = BackendManager.getBackend();
Expand Down Expand Up @@ -55,7 +57,7 @@ public static void registerClientCommands(RegisterClientCommandsEvent event) {
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()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
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;
Expand Down Expand Up @@ -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();

Expand Down Expand Up @@ -97,7 +97,7 @@ private static void registerImplEventListeners(IEventBus forgeEventBus, IEventBu
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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import com.google.common.base.Suppliers;

public class SodiumMixinPlugin implements IMixinConfigPlugin {
private static final Supplier<Boolean> IS_SODIUM_LOADED = Suppliers.memoize(() -> LoadingModList.get().getModFileById("rubidium") != null);
private static final Supplier<Boolean> IS_SODIUM_LOADED = Suppliers.memoize(() -> LoadingModList.get().getModFileById("embeddium") != null);

@Override
public void onLoad(String mixinPackage) {
Expand Down
8 changes: 0 additions & 8 deletions forge/src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit 4190ac7

Please sign in to comment.