generated from BocchiKessokuTeam/ForgeTemplateMod-ArchLoom
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
37 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/main/java/org/thinkingstudio/mafglib/util/ForgePlatformUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
src/main/java/org/thinkingstudio/mafglib/util/ModConfigScreenProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} |