-
Notifications
You must be signed in to change notification settings - Fork 0
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
14 changed files
with
87 additions
and
47 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,5 +1,8 @@ | ||
# MehradConfig | ||
[![JitPack](https://jitpack.io/v/MehradN/MehradConfig.svg)](https://jitpack.io/#MehradN/MehradConfig) | ||
|
||
A simple looking, instance based config library for minecraft. | ||
|
||
I made this library to use it in my own mods. Feel free to use it, as it is fully documented and examples are available in the [testmod directory](https://github.com/MehradN/MehradConfig/tree/master/src/testmod). | ||
I made this library to use it in my own mods. Feel free to use it, as it is [fully documented](https://jitpack.io/com/github/MehradN/MehradConfig/latest/javadoc/) and examples are available in the [testmod directory](https://github.com/MehradN/MehradConfig/tree/master/src/testmod). | ||
|
||
You can use it in your mods with [JitPack](https://jitpack.io/#MehradN/MehradConfig). |
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
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
26 changes: 26 additions & 0 deletions
26
src/client/java/ir/mehradn/mehradconfig/entrypoint/ModMenuConfigScreen.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,26 @@ | ||
package ir.mehradn.mehradconfig.entrypoint; | ||
|
||
import ir.mehradn.mehradconfig.gui.ConfigScreenBuilder; | ||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
/** | ||
* This class is used for registering your config screen builders for ModMenu. | ||
* | ||
* @see #register | ||
*/ | ||
public class ModMenuConfigScreen { | ||
static final Map<String, ConfigScreenBuilder> modMenuScreenBuilders = new HashMap<>(); | ||
|
||
/** | ||
* Registers a config screen builder to build screens for ModMenu. The screen will be created by {@link ConfigScreenBuilder#buildAndLoad}. | ||
* This method by itself won't register your config, and you need to call {@link ModMenuConfig#register} before this in the main entrypoint of | ||
* your mod. | ||
* | ||
* @param modId the mod id of your mod | ||
* @param configScreenBuilder the config screen builder to build the screen with | ||
*/ | ||
public static void register(String modId, ConfigScreenBuilder configScreenBuilder) { | ||
modMenuScreenBuilders.put(modId, configScreenBuilder); | ||
} | ||
} |
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
35 changes: 0 additions & 35 deletions
35
src/client/java/ir/mehradn/mehradconfig/entrypoint/ModMenuSupport.java
This file was deleted.
Oops, something went wrong.
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
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
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
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
26 changes: 26 additions & 0 deletions
26
src/main/java/ir/mehradn/mehradconfig/entrypoint/ModMenuConfig.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,26 @@ | ||
package ir.mehradn.mehradconfig.entrypoint; | ||
|
||
import ir.mehradn.mehradconfig.MehradConfig; | ||
import java.util.HashMap; | ||
import java.util.Map; | ||
import java.util.function.Supplier; | ||
|
||
/** | ||
* This class is used for registering your configs for ModMenu. | ||
* | ||
* @see #register | ||
*/ | ||
public final class ModMenuConfig { | ||
static final Map<String, Supplier<MehradConfig>> modMenuConfigs = new HashMap<>(); | ||
|
||
/** | ||
* Registers a config constructor for ModMenu. The screen will by default use the compact default screen type. | ||
* Checkout {@code ModMenuConfigScreen} for customizing the config screen. | ||
* | ||
* @param modId the mod id of your mod | ||
* @param configConstructor a constructor for the type of the config to load, modify and save | ||
*/ | ||
public static void register(String modId, Supplier<MehradConfig> configConstructor) { | ||
modMenuConfigs.put(modId, configConstructor); | ||
} | ||
} |
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
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
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