-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add server config for BioForge recipe unlocking and villager tr…
…ades
- Loading branch information
1 parent
dd31596
commit 47a8b12
Showing
5 changed files
with
69 additions
and
1 deletion.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
src/main/java/com/github/elenterius/biomancy/BiomancyConfig.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 com.github.elenterius.biomancy; | ||
|
||
import com.github.elenterius.biomancy.config.ServerConfig; | ||
import net.minecraftforge.common.ForgeConfigSpec; | ||
import net.minecraftforge.fml.ModLoadingContext; | ||
import net.minecraftforge.fml.config.ModConfig; | ||
import org.apache.commons.lang3.tuple.Pair; | ||
|
||
public final class BiomancyConfig { | ||
|
||
public static final ForgeConfigSpec SERVER_SPECIFICATION; | ||
public static final ServerConfig SERVER; | ||
|
||
private BiomancyConfig() {} | ||
|
||
static { | ||
Pair<ServerConfig, ForgeConfigSpec> specPair = new ForgeConfigSpec.Builder().configure(ServerConfig::new); | ||
SERVER = specPair.getLeft(); | ||
SERVER_SPECIFICATION = specPair.getRight(); | ||
} | ||
|
||
public static void register(ModLoadingContext modLoadingContext) { | ||
modLoadingContext.registerConfig(ModConfig.Type.SERVER, BiomancyConfig.SERVER_SPECIFICATION); | ||
} | ||
|
||
} |
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
33 changes: 33 additions & 0 deletions
33
src/main/java/com/github/elenterius/biomancy/config/ServerConfig.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,33 @@ | ||
package com.github.elenterius.biomancy.config; | ||
|
||
import net.minecraftforge.common.ForgeConfigSpec; | ||
|
||
public class ServerConfig { | ||
|
||
public final ForgeConfigSpec.BooleanValue doBioForgeRecipeProgression; | ||
public final ForgeConfigSpec.BooleanValue addTradesToVillagers; | ||
public final ForgeConfigSpec.BooleanValue addTradesToWanderingTrader; | ||
|
||
public ServerConfig(ForgeConfigSpec.Builder builder) { | ||
builder.push("recipes"); | ||
|
||
doBioForgeRecipeProgression = builder | ||
.comment("Determines if the BioForge recipes need to be unlocked to be able to craft them") | ||
.define("doBioForgeRecipeProgression", true); | ||
|
||
builder.pop(); | ||
|
||
builder.push("trades"); | ||
|
||
addTradesToVillagers = builder | ||
.comment("Determines if villagers will sell biomancy items") | ||
.define("addTradesToVillagers", true); | ||
|
||
addTradesToWanderingTrader = builder | ||
.comment("Determines if wandering traders will sell biomancy items") | ||
.define("addTradesToWanderingTrader", true); | ||
|
||
builder.pop(); | ||
} | ||
|
||
} |
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