Skip to content

Commit

Permalink
Added config to disable BOP's Wandering Trader trades (Closes #2184)
Browse files Browse the repository at this point in the history
  • Loading branch information
Forstride committed Mar 4, 2024
1 parent 48269a0 commit edab444
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
25 changes: 25 additions & 0 deletions common/src/main/java/biomesoplenty/config/GameplayConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*******************************************************************************
* Copyright 2024, the Glitchfiend Team.
* All rights reserved.
******************************************************************************/
package biomesoplenty.config;

import biomesoplenty.core.BiomesOPlenty;
import glitchcore.config.Config;
import glitchcore.util.Environment;

public class GameplayConfig extends Config
{
public boolean wanderingTraderTrades;

public GameplayConfig()
{
super(Environment.getConfigPath().resolve(BiomesOPlenty.MOD_ID + "/gameplay.toml"));
}

@Override
public void load()
{
wanderingTraderTrades = add("general.wandering_trader_trades", true, "Add various BOP resources to the Wandering Trader trade pool.");
}
}
2 changes: 1 addition & 1 deletion common/src/main/java/biomesoplenty/core/BiomesOPlenty.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ private static void addRegistrars()
private static void addHandlers()
{
// Misc handlers
EventManager.addListener(ModVillagerTrades::addWanderingVillagerTrades);
if (ModConfig.gameplay.wanderingTraderTrades) { EventManager.addListener(ModVillagerTrades::addWanderingVillagerTrades); }

if (Environment.isClient())
{
Expand Down
2 changes: 2 additions & 0 deletions common/src/main/java/biomesoplenty/init/ModConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
package biomesoplenty.init;

import biomesoplenty.api.biome.BOPBiomes;
import biomesoplenty.config.GameplayConfig;
import biomesoplenty.config.GenerationConfig;
import biomesoplenty.core.BiomesOPlenty;
import biomesoplenty.util.config.JsonUtil;
Expand All @@ -30,6 +31,7 @@ public class ModConfig
private static final TreeMap<String, Boolean> defaultBiomeToggles = Maps.newTreeMap();

public static GenerationConfig generation = new GenerationConfig();
public static GameplayConfig gameplay = new GameplayConfig();

public static void setup()
{
Expand Down

0 comments on commit edab444

Please sign in to comment.