Skip to content

Commit

Permalink
fix compat
Browse files Browse the repository at this point in the history
  • Loading branch information
TexBlock committed Jul 29, 2024
1 parent 4612a1e commit 272b100
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 3 deletions.
3 changes: 1 addition & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
## Changelog
- rewrite `ForgeUtils`
- update Forge to `1.20.1-47.3.5`
- fix compat
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ loom.platform=forge
yarn_mappings=1.20.1+build.10

# Mod Properties
mod_version=0.1.12
mod_version=0.1.13
maven_group=org.thinkingstudio.mafglib
archives_base_name=MaFgLib
mod_id=mafglib
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package org.thinkingstudio.mafglib.util;

import net.minecraftforge.fml.ModContainer;
import net.minecraftforge.fml.ModList;
import net.minecraftforge.fml.ModLoadingContext;

@Deprecated
public class ForgePlatformUtils {
private static final ModLoadingContext context = ModLoadingContext.get();

public static ForgePlatformUtils getInstance() {
return new ForgePlatformUtils();
}

public void getClientModIgnoredServerOnly() {
ForgeUtils.getInstance().getClientModIgnoredServerOnly(context.getActiveContainer());
}

public void registerModConfigScreen(String modid, ModConfigScreenProvider configScreenProvider) {
ModContainer modContainer = ModList.get().getModContainerById(modid).orElseThrow();
ForgeUtils.getInstance().registerModConfigScreen(modContainer, configScreenProvider::provide);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package org.thinkingstudio.mafglib.util;

import net.minecraft.client.gui.screen.Screen;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;

@Deprecated
@OnlyIn(Dist.CLIENT)
@FunctionalInterface
public interface ModConfigScreenProvider {
Screen provide(Screen parent);
}

0 comments on commit 272b100

Please sign in to comment.