Skip to content

Commit

Permalink
Merge pull request #322 from GrowthcraftCE/bugfix/316-NullPointer-Ket…
Browse files Browse the repository at this point in the history
…tle-Recipe-Bug

Added configuration options for all of GC Cellar
  • Loading branch information
Alatyami authored Mar 1, 2020
2 parents 1d30fbe + b9135ed commit 3207f34
Show file tree
Hide file tree
Showing 2 changed files with 110 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,35 +11,40 @@
public class GrowthcraftCellarConfig {
// OPEN

/* CATEGORIES */
private static final String CATEGORY_GENERAL = "general";
private static final String CATEGORY_PRODUCTION = "production";
private static final String CATEGORY_CORKTREE = "cork_tree";
public static Configuration configuration;

// TODO: Bind them!
public static final boolean enableDiscardButton = true;
// region General Configuration Settiings
public static boolean enableDiscardButton = true;
public static boolean boozeEffectsEnabled = true;
public static boolean boozeIsWater = false;
public static int fermentTime = 24000;
public static int brewKettleMaxCap = 1000;
public static boolean brewKettleFillsWithRain = true;
public static int brewKettleRainFillPerUnit = 10;
public static boolean dropItemsInBrewKettle = true;
public static boolean setFireToFallenLivingEntities = true;
public static boolean fermentBarrelUseCachedRecipe = true;
public static int fermentBarrelMaxCap = 3000;
public static boolean dropItemsInBrewKettle = true;
public static int brewKettleRainFillPerUnit = 10;
public static boolean brewKettleFillsWithRain = true;

// endregion

// region Production Configuration Settings
public static int fermentBarrelMaxCap = 4000;
public static int cultureJarTimeMax = 1200;
public static int cultureJarConsumption = 1000 / 4;
public static int cultureJarMaxCap = 1000;
public static int fruitPressMaxCap = 1000;

// Configurable settings.
public static boolean fermentBarrelUseCachedRecipe = true;
public static int fermentTime = 24000;
public static int brewKettleMaxCap = 1000;
public static boolean allowFallbackRecipes = true;

// Cork Tree Settings
// endregion

// region Cork Tree Configuration Settings
public static int corkBarkGrowthChance = 50;
// endregion

/* CATEGORIES */
private static final String CATEGORY_GENERAL = "general";
private static final String CATEGORY_PRODUCTION = "production";
private static final String CATEGORY_CORKTREE = "cork_tree";

public static void preInit(FMLPreInitializationEvent e) {
File directory = e.getModConfigurationDirectory();
Expand All @@ -61,13 +66,99 @@ public static void readConfig() {
}

private static void initGeneralConfig() {
// OPEN_ADHOC
// General Category
enableDiscardButton = configuration.getBoolean(
"enableDiscardButton",
CATEGORY_GENERAL,
enableDiscardButton,
"Provides a button in the GUI to 'dump' the fluid contents in the FluidTank."
);
boozeEffectsEnabled = configuration.getBoolean(
"boozeEffectsEnabled",
CATEGORY_GENERAL,
boozeEffectsEnabled,
"Toggle the availability of booze effects."
);
boozeIsWater = configuration.getBoolean(
"boozeIsWater",
CATEGORY_GENERAL,
boozeIsWater,
"Treat booze as water."
);
dropItemsInBrewKettle = configuration.getBoolean(
"dropItemsInBrewKettle",
CATEGORY_GENERAL,
dropItemsInBrewKettle,
"When a brew kettle is destroyed, should the contains be dumped into the world."
);
brewKettleRainFillPerUnit = configuration.getInt(
"brewKettleRainFillPerUnit",
CATEGORY_GENERAL,
brewKettleRainFillPerUnit,
10, 100,
"How much mb per rain does the kettle fill with water."
);
brewKettleFillsWithRain = configuration.getBoolean(
"brewKettleFillsWithRain",
CATEGORY_GENERAL,
brewKettleFillsWithRain,
"Allow the kettle to fill with water when exposed to rain."
);

// Production Category
allowFallbackRecipes = configuration.getBoolean(
"allowFallbackRecipes",
CATEGORY_PRODUCTION, true,
"If true then fallback recipes are activated. E.g. booze spoiling when using invalid ingredient.");
fermentBarrelMaxCap = configuration.getInt(
"fermentBarrelMaxCap",
CATEGORY_PRODUCTION,
fermentBarrelMaxCap,
1000, 10000,
"Set the maximum capacity of the fermentation barrel."
);
cultureJarTimeMax = configuration.getInt(
"cultureJarTimeMax",
CATEGORY_PRODUCTION,
cultureJarTimeMax,
100, 2400,
"Maximum time it takes to process something in the culture jar."
);
cultureJarConsumption = configuration.getInt(
"cultureJarConsumption",
CATEGORY_PRODUCTION,
cultureJarConsumption,
100, 1000,
"Set the consumption rate of fluids in the culture jar."
);
cultureJarMaxCap = configuration.getInt(
"cultureJarMaxCap",
CATEGORY_PRODUCTION,
cultureJarMaxCap,
250, 2000,
"Maximum fluid capacity of the culture jar."
);
fruitPressMaxCap = configuration.getInt(
"fruitPressMaxCap",
CATEGORY_PRODUCTION,
fruitPressMaxCap,
250, 4000,
"Maximum fluid capacity of the fruit press."
);
fermentTime = configuration.getInt(
"fermentTime",
CATEGORY_PRODUCTION,
fermentTime,
100, 48000,
"How many ticks to ferment fluid in the fermentation barrel."
);
brewKettleMaxCap = configuration.getInt(
"brewKettleMaxCap",
CATEGORY_PRODUCTION,
brewKettleMaxCap,
250, 4000,
"Maximum fluid capacity of the brew kettle."
);

// Cork Tree Category Settings
corkBarkGrowthChance = configuration.getInt(
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/assets/growthcraft_milk/lang/en_us.lang
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ fluid.fluid_skim_milk=Skim Milk
fluid.fluid_whey=Whey
fluid.fluid_condensed_milk=Condensed Milk

fluid.tags.rennet=Rennet

# Items
item.bottlefluid_milk.name=Milk Bottle
item.bottlefluid_butter_milk.name=Butter Milk Bottle
Expand Down

0 comments on commit 3207f34

Please sign in to comment.