Skip to content

Commit

Permalink
clean up configs a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
serenibyss committed Aug 12, 2021
1 parent 052fd4e commit 3789f4b
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

@ZenClass("mods.gregtech.item.ItemRegistry")
@ZenRegister
@SuppressWarnings("unused")
public class CTItemUtils {

@ZenMethod("registerItem")
Expand Down
35 changes: 16 additions & 19 deletions src/main/java/gregtech/common/ConfigHolder.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,6 @@ public class ConfigHolder {
@Config.Name("Unofficial Options")
public static UnofficialOptions U = new UnofficialOptions();

@Config.Comment("Whether to enable that Steam Multiblocks use Steel instead of Bronze. Default: false")
@Config.RequiresMcRestart
public static boolean steelSteamMultiblocks = false;

@Config.Comment("Steam to EU multiplier for Steam Multiblocks. 1.0 means 1 Steam -> 1 EU. 0.5 means 2 Steam -> 1 EU")
@Config.RequiresMcRestart
public static double multiblockSteamtoEU = 0.5;

@Config.Comment("Whether to enable more verbose logging. Default: false")
public static boolean debug = false;

Expand Down Expand Up @@ -191,10 +183,18 @@ public static class UnofficialOptions {
@Config.RequiresMcRestart
public boolean registerRecipesForMiningHammers = true;

@Config.Comment("Divisor for Recipe Duration per Overclock. This will be removed eventually, once a value is chosen. Default: 2.0")
@Config.Comment("Divisor for Recipe Duration per Overclock. Default: 2.0")
@Config.RangeDouble(min = 2.0, max = 3.0)
public double overclockDivisor = 2.0;

@Config.Comment("Whether to enable that Steam Multiblocks use Steel instead of Bronze. Default: false")
@Config.RequiresMcRestart
public boolean steelSteamMultiblocks = false;

@Config.Comment("Steam to EU multiplier for Steam Multiblocks. 1.0 means 1 Steam -> 1 EU. 0.5 means 2 Steam -> 1 EU. Default: 0.5")
@Config.RequiresWorldRestart
public double multiblockSteamToEU = 0.5;

public static class GT5U {

@Config.Comment("Enable an extra ZPM and UV Battery (this also makes the Ultimate Battery harder to make). Default: false")
Expand All @@ -205,48 +205,45 @@ public static class GT5U {
@Config.RequiresMcRestart
public boolean replaceUVwithMAXBat = false;

@Config.Comment("This config requires 'B:Use custom machine tank sizes' = true to take effect. Changes the input tank size to the first value, and out tank size to the second value for nearly every single block machine. Units are millibuckets.")
@Config.Name("Custom machine fluid tank sizes")
@Config.Comment("This config requires 'B:Use custom machine tank sizes' = true to take effect. Changes the input tank size to the first value, and out tank size to the second value for nearly every single block machine. Units are millibuckets. Default: {64000, 64000}")
@Config.RangeInt(min = 1)
@Config.RequiresMcRestart
public int[] customMachineTankSizes = new int[]{64000, 64000};

@Config.Comment("This config enables the customization of nearly every single block machine's input and output fluid tank sizes.")
@Config.Name("Use custom machine tank sizes")
@Config.Comment("This config enables the customization of nearly every single block machine's input and output fluid tank sizes. Default: false")
@Config.RequiresMcRestart
public boolean useCustomMachineTankSizes = false;

@Config.Comment("Require Wrench to break machines? Default: false")
public boolean requireWrenchForMachines = false;

@Config.Comment("Change the recipe of rods to result in 1 stick and 2 small piles of dusts. Default: false")
@Config.RequiresMcRestart
public boolean harderRods = false;

@Config.Comment("Whether or not to use polymers instead of rare metals for Carbon Fibers. REMOVES THE CHANCED OUTPUT! Default: false")
@Config.RequiresMcRestart
public boolean polymerCarbonFiber = false;

@Config.Comment("The default color to overlay onto machines. \n16777215 (0xFFFFFF in decimal) is no coloring (default), and 13819135 (0xD2DCFF in decimal) is the classic blue from GT5. THIS IS SERVER SIDE!!!")
@Config.Name("Default Machine Color")
@Config.RequiresMcRestart
public int defaultPaintingColor = 0xFFFFFF;

@Config.Comment("The default color to overlay onto cable insulation. \n7829367 (0x777777 in decimal) is no coloring (default), and 4210752 (0x404040 in decimal) is the classic black from GT5. THIS IS SERVER SIDE!!!")
@Config.Name("Default Cable Color")
@Config.RequiresMcRestart
public int defaultInsulationColor = 0x777777;

@Config.Comment("Enable temperature based bonuses for the Electric Blast Furnace. Default: true")
@Config.Name("Use electric blast furnace temperature bonuses")
@Config.RequiresMcRestart
public boolean ebfTemperatureBonuses = true;

@Config.Comment("Enable more challenging recipes for Electric Blast Furnace Coils. Default: true")
@Config.Name("Enable harder heating coil recipes")
@Config.RequiresMcRestart
public boolean harderHeatingCoils = true;

@Config.Comment("Enable more challenging recipes for Energy Input and Output hatches. Default: false")
@Config.Name("Enable harder energy hatch recipes")
public boolean harderEnergyHatches = true;
@Config.RequiresMcRestart
public boolean harderEnergyHatches = false;
}

public static class GT6 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

public class MetaTileEntitySteamGrinder extends RecipeMapSteamMultiblockController {

private static final double CONVERSION_RATE = ConfigHolder.multiblockSteamtoEU;
private static final double CONVERSION_RATE = ConfigHolder.U.multiblockSteamToEU;

private static final MultiblockAbility<?>[] ALLOWED_ABILITIES = {
MultiblockAbility.STEAM_IMPORT_ITEMS, MultiblockAbility.STEAM_EXPORT_ITEMS, MultiblockAbility.STEAM
Expand Down Expand Up @@ -56,12 +56,12 @@ protected BlockPattern createStructurePattern() {
}

public IBlockState getCasingState() {
return ConfigHolder.steelSteamMultiblocks ? MetaBlocks.METAL_CASING.getState(BlockMetalCasing.MetalCasingType.STEEL_SOLID) : MetaBlocks.METAL_CASING.getState(BlockMetalCasing.MetalCasingType.BRONZE_BRICKS);
return ConfigHolder.U.steelSteamMultiblocks ? MetaBlocks.METAL_CASING.getState(BlockMetalCasing.MetalCasingType.STEEL_SOLID) : MetaBlocks.METAL_CASING.getState(BlockMetalCasing.MetalCasingType.BRONZE_BRICKS);
}

@Override
public ICubeRenderer getBaseTexture(IMultiblockPart sourcePart) {
return ConfigHolder.steelSteamMultiblocks ? SOLID_STEEL_CASING : BRONZE_PLATED_BRICKS;
return ConfigHolder.U.steelSteamMultiblocks ? SOLID_STEEL_CASING : BRONZE_PLATED_BRICKS;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

public class MetaTileEntitySteamOven extends RecipeMapSteamMultiblockController {

private static final double CONVERSION_RATE = ConfigHolder.multiblockSteamtoEU;
private static final double CONVERSION_RATE = ConfigHolder.U.multiblockSteamToEU;
private boolean isActive;

public MetaTileEntitySteamOven(ResourceLocation metaTileEntityId) {
Expand Down Expand Up @@ -71,13 +71,13 @@ protected BlockPattern createStructurePattern() {
}

public IBlockState getCasingState() {
return ConfigHolder.steelSteamMultiblocks ?
return ConfigHolder.U.steelSteamMultiblocks ?
MetaBlocks.METAL_CASING.getState(BlockMetalCasing.MetalCasingType.STEEL_SOLID) :
MetaBlocks.METAL_CASING.getState(BlockMetalCasing.MetalCasingType.BRONZE_BRICKS);
}

public IBlockState getFireboxState() {
return ConfigHolder.steelSteamMultiblocks ?
return ConfigHolder.U.steelSteamMultiblocks ?
MetaBlocks.BOILER_FIREBOX_CASING.getState(BlockFireboxCasing.FireboxCasingType.STEEL_FIREBOX) :
MetaBlocks.BOILER_FIREBOX_CASING.getState(BlockFireboxCasing.FireboxCasingType.BRONZE_FIREBOX);
}
Expand All @@ -88,7 +88,7 @@ private boolean isFireboxPart(IMultiblockPart sourcePart) {

@Override
public ICubeRenderer getBaseTexture(IMultiblockPart sourcePart) {
if (ConfigHolder.steelSteamMultiblocks) {
if (ConfigHolder.U.steelSteamMultiblocks) {
if (sourcePart != null && isFireboxPart(sourcePart)) {
return isActive ? Textures.STEEL_FIREBOX_ACTIVE : Textures.STEEL_FIREBOX;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public void renderMetaTileEntity(CCRenderState renderState, Matrix4 translation,
public ICubeRenderer getBaseTexture() {
MultiblockControllerBase controller = getController();
if (controller == null)
return ConfigHolder.steelSteamMultiblocks ? Textures.SOLID_STEEL_CASING : Textures.BRONZE_PLATED_BRICKS;
return ConfigHolder.U.steelSteamMultiblocks ? Textures.SOLID_STEEL_CASING : Textures.BRONZE_PLATED_BRICKS;
return controller.getBaseTexture(this);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public void registerAbilities(List<IItemHandlerModifiable> abilityList) {
public ICubeRenderer getBaseTexture() {
MultiblockControllerBase controller = getController();
if (controller == null)
return ConfigHolder.steelSteamMultiblocks ? Textures.SOLID_STEEL_CASING : Textures.BRONZE_PLATED_BRICKS;
return ConfigHolder.U.steelSteamMultiblocks ? Textures.SOLID_STEEL_CASING : Textures.BRONZE_PLATED_BRICKS;
return controller.getBaseTexture(this);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public MultiblockControllerBase getController() {
public List<MultiblockShapeInfo> getMatchingShapes() {
ArrayList<MultiblockShapeInfo> shapeInfo = new ArrayList<>();

if (ConfigHolder.steelSteamMultiblocks) {
if (ConfigHolder.U.steelSteamMultiblocks) {
shapeInfo.add(MultiblockShapeInfo.builder()
.aisle("XXX", "IXX", "XXX")
.aisle("HXX", "S#X", "XXX")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public MultiblockControllerBase getController() {
public List<MultiblockShapeInfo> getMatchingShapes() {
ArrayList<MultiblockShapeInfo> shapeInfo = new ArrayList<>();

if (ConfigHolder.steelSteamMultiblocks) {
if (ConfigHolder.U.steelSteamMultiblocks) {
shapeInfo.add(MultiblockShapeInfo.builder()
.aisle("FFF", "IXX", "###")
.aisle("HFF", "S#X", "XXX")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
public class MetaTileEntityLoader {

public static void init() {
if (ConfigHolder.steelSteamMultiblocks) {
if (ConfigHolder.U.steelSteamMultiblocks) {
ModHandler.addShapedRecipe("steam_oven", MetaTileEntities.STEAM_OVEN.getStackForm(), "CGC", "FMF", "CGC", 'F', MetaBlocks.BOILER_FIREBOX_CASING.getItemVariant(STEEL_FIREBOX), 'C', MetaBlocks.METAL_CASING.getItemVariant(STEEL_SOLID), 'M', MetaTileEntities.STEAM_FURNACE_STEEL.getStackForm(), 'G', new UnificationEntry(OrePrefix.gear, Materials.Invar));
ModHandler.addShapedRecipe("steam_grinder", MetaTileEntities.STEAM_GRINDER.getStackForm(), "CGC", "CFC", "CGC", 'G', new UnificationEntry(OrePrefix.gear, Materials.Potin), 'F', MetaTileEntities.STEAM_MACERATOR_STEEL.getStackForm(), 'C', MetaBlocks.METAL_CASING.getItemVariant(STEEL_SOLID));
ModHandler.addShapedRecipe("steam_hatch", MetaTileEntities.STEAM_HATCH.getStackForm(), "BPB", "BTB", "BPB", 'B', new UnificationEntry(OrePrefix.plate, Materials.Steel), 'P', new UnificationEntry(OrePrefix.pipeNormalFluid, Materials.Steel), 'T', MetaTileEntities.STEEL_TANK.getStackForm());
Expand Down

0 comments on commit 3789f4b

Please sign in to comment.