-
Notifications
You must be signed in to change notification settings - Fork 158
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
3 changed files
with
58 additions
and
10 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
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
48 changes: 48 additions & 0 deletions
48
src/main/java/com/jaquadro/minecraft/storagedrawers/config/ClientConfig.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,48 @@ | ||
package com.jaquadro.minecraft.storagedrawers.config; | ||
|
||
import net.minecraftforge.common.ForgeConfigSpec; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class ClientConfig | ||
{ | ||
private static final ForgeConfigSpec.Builder BUILDER = new ForgeConfigSpec.Builder(); | ||
public static final General GENERAL = new General(BUILDER); | ||
public static final ForgeConfigSpec spec = BUILDER.build(); | ||
|
||
private static boolean loaded = false; | ||
private static List<Runnable> loadActions = new ArrayList<>(); | ||
|
||
public static void setLoaded() { | ||
if (!loaded) | ||
loadActions.forEach(Runnable::run); | ||
loaded = true; | ||
} | ||
|
||
public static boolean isLoaded() { | ||
return loaded; | ||
} | ||
|
||
public static void onLoad(Runnable action) { | ||
if (loaded) | ||
action.run(); | ||
else | ||
loadActions.add(action); | ||
} | ||
|
||
public static class General { | ||
public final ForgeConfigSpec.ConfigValue<Boolean> invertShift; | ||
|
||
public General(ForgeConfigSpec.Builder builder) { | ||
builder.push("General"); | ||
List<String> test = new ArrayList<>(); | ||
test.add("minecraft:clay, minecraft:clay_ball, 4"); | ||
|
||
invertShift = builder | ||
.define("invertShift", false); | ||
|
||
builder.pop(); | ||
} | ||
} | ||
} |