Skip to content

Commit

Permalink
Fix neoforge config
Browse files Browse the repository at this point in the history
  • Loading branch information
dima-dencep committed Jul 30, 2024
1 parent 5af0624 commit 2397dcd
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import net.minecraft.network.chat.Component;
import net.neoforged.fml.config.ModConfig;
import net.neoforged.neoforge.client.gui.ConfigurationScreen;
import net.neoforged.neoforge.common.ModConfigSpec;
import org.redlance.dima_dencep.mods.rrls.Rrls;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
Expand All @@ -29,17 +30,17 @@ public abstract class ConfigurationSectionScreenMixin {
@Final
protected ConfigurationScreen.ConfigurationSectionScreen.Context context;
@Shadow
protected ConfigurationScreen.RestartType needsRestart;
protected ModConfigSpec.RestartType needsRestart;

@Inject(
method = "<init>(Lnet/minecraft/client/gui/screens/Screen;Lnet/neoforged/fml/config/ModConfig$Type;Lnet/neoforged/fml/config/ModConfig;Lnet/minecraft/network/chat/Component;)V",
method = "<init>(Lnet/minecraft/client/gui/screens/Screen;Lnet/neoforged/fml/config/ModConfig$Type;Lnet/neoforged/fml/config/ModConfig;Lnet/minecraft/network/chat/Component;Lnet/neoforged/neoforge/client/gui/ConfigurationScreen$ConfigurationSectionScreen$Filter;)V",
at = @At(
value = "TAIL"
)
)
public void rrls$fixStartupConfigs(Screen parent, ModConfig.Type type, ModConfig modConfig, Component title, CallbackInfo ci) {
public void rrls$fixStartupConfigs(Screen parent, ModConfig.Type type, ModConfig modConfig, Component title, ConfigurationScreen.ConfigurationSectionScreen.Filter filter, CallbackInfo ci) {
if (Rrls.MOD_ID.equals(context.modId())) {
this.needsRestart = ConfigurationScreen.RestartType.NONE;
this.needsRestart = ModConfigSpec.RestartType.NONE;
}
}

Expand Down

0 comments on commit 2397dcd

Please sign in to comment.