From 3789f4b569cf133fb5348b67b36cc786ca15ca15 Mon Sep 17 00:00:00 2001 From: DStrand1 Date: Wed, 11 Aug 2021 22:40:41 -0500 Subject: [PATCH] clean up configs a bit --- .../api/items/crafttweaker/CTItemUtils.java | 1 + .../java/gregtech/common/ConfigHolder.java | 35 +++++++++---------- .../steam/MetaTileEntitySteamGrinder.java | 6 ++-- .../multi/steam/MetaTileEntitySteamOven.java | 8 ++--- .../MetaTileEntitySteamHatch.java | 2 +- .../MetaTileEntitySteamItemBus.java | 2 +- .../multiblock/infos/SteamGrinderInfo.java | 2 +- .../jei/multiblock/infos/SteamOvenInfo.java | 2 +- .../loaders/recipe/MetaTileEntityLoader.java | 2 +- 9 files changed, 29 insertions(+), 31 deletions(-) diff --git a/src/main/java/gregtech/api/items/crafttweaker/CTItemUtils.java b/src/main/java/gregtech/api/items/crafttweaker/CTItemUtils.java index 7b23115631f..4b8d4182125 100644 --- a/src/main/java/gregtech/api/items/crafttweaker/CTItemUtils.java +++ b/src/main/java/gregtech/api/items/crafttweaker/CTItemUtils.java @@ -9,6 +9,7 @@ @ZenClass("mods.gregtech.item.ItemRegistry") @ZenRegister +@SuppressWarnings("unused") public class CTItemUtils { @ZenMethod("registerItem") diff --git a/src/main/java/gregtech/common/ConfigHolder.java b/src/main/java/gregtech/common/ConfigHolder.java index ce9bd6a06f8..957f7840c77 100644 --- a/src/main/java/gregtech/common/ConfigHolder.java +++ b/src/main/java/gregtech/common/ConfigHolder.java @@ -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; @@ -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") @@ -205,14 +205,12 @@ 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; @@ -220,33 +218,32 @@ public static class GT5U { 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 { diff --git a/src/main/java/gregtech/common/metatileentities/multi/steam/MetaTileEntitySteamGrinder.java b/src/main/java/gregtech/common/metatileentities/multi/steam/MetaTileEntitySteamGrinder.java index 0e89567ccb7..90a476adb8c 100644 --- a/src/main/java/gregtech/common/metatileentities/multi/steam/MetaTileEntitySteamGrinder.java +++ b/src/main/java/gregtech/common/metatileentities/multi/steam/MetaTileEntitySteamGrinder.java @@ -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 @@ -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 diff --git a/src/main/java/gregtech/common/metatileentities/multi/steam/MetaTileEntitySteamOven.java b/src/main/java/gregtech/common/metatileentities/multi/steam/MetaTileEntitySteamOven.java index 067dccf0ffa..66f8e453821 100644 --- a/src/main/java/gregtech/common/metatileentities/multi/steam/MetaTileEntitySteamOven.java +++ b/src/main/java/gregtech/common/metatileentities/multi/steam/MetaTileEntitySteamOven.java @@ -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) { @@ -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); } @@ -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; } diff --git a/src/main/java/gregtech/common/metatileentities/steam/multiblockpart/MetaTileEntitySteamHatch.java b/src/main/java/gregtech/common/metatileentities/steam/multiblockpart/MetaTileEntitySteamHatch.java index e2ac1f3d5da..4489b2d4ccb 100644 --- a/src/main/java/gregtech/common/metatileentities/steam/multiblockpart/MetaTileEntitySteamHatch.java +++ b/src/main/java/gregtech/common/metatileentities/steam/multiblockpart/MetaTileEntitySteamHatch.java @@ -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); } diff --git a/src/main/java/gregtech/common/metatileentities/steam/multiblockpart/MetaTileEntitySteamItemBus.java b/src/main/java/gregtech/common/metatileentities/steam/multiblockpart/MetaTileEntitySteamItemBus.java index ce0a1fad472..d157030cbc5 100644 --- a/src/main/java/gregtech/common/metatileentities/steam/multiblockpart/MetaTileEntitySteamItemBus.java +++ b/src/main/java/gregtech/common/metatileentities/steam/multiblockpart/MetaTileEntitySteamItemBus.java @@ -53,7 +53,7 @@ public void registerAbilities(List 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); } diff --git a/src/main/java/gregtech/integration/jei/multiblock/infos/SteamGrinderInfo.java b/src/main/java/gregtech/integration/jei/multiblock/infos/SteamGrinderInfo.java index debadf50cf4..07642818277 100644 --- a/src/main/java/gregtech/integration/jei/multiblock/infos/SteamGrinderInfo.java +++ b/src/main/java/gregtech/integration/jei/multiblock/infos/SteamGrinderInfo.java @@ -26,7 +26,7 @@ public MultiblockControllerBase getController() { public List getMatchingShapes() { ArrayList shapeInfo = new ArrayList<>(); - if (ConfigHolder.steelSteamMultiblocks) { + if (ConfigHolder.U.steelSteamMultiblocks) { shapeInfo.add(MultiblockShapeInfo.builder() .aisle("XXX", "IXX", "XXX") .aisle("HXX", "S#X", "XXX") diff --git a/src/main/java/gregtech/integration/jei/multiblock/infos/SteamOvenInfo.java b/src/main/java/gregtech/integration/jei/multiblock/infos/SteamOvenInfo.java index 927650958e5..0044bc00ac8 100644 --- a/src/main/java/gregtech/integration/jei/multiblock/infos/SteamOvenInfo.java +++ b/src/main/java/gregtech/integration/jei/multiblock/infos/SteamOvenInfo.java @@ -27,7 +27,7 @@ public MultiblockControllerBase getController() { public List getMatchingShapes() { ArrayList shapeInfo = new ArrayList<>(); - if (ConfigHolder.steelSteamMultiblocks) { + if (ConfigHolder.U.steelSteamMultiblocks) { shapeInfo.add(MultiblockShapeInfo.builder() .aisle("FFF", "IXX", "###") .aisle("HFF", "S#X", "XXX") diff --git a/src/main/java/gregtech/loaders/recipe/MetaTileEntityLoader.java b/src/main/java/gregtech/loaders/recipe/MetaTileEntityLoader.java index a1a59140985..e009e4763ad 100644 --- a/src/main/java/gregtech/loaders/recipe/MetaTileEntityLoader.java +++ b/src/main/java/gregtech/loaders/recipe/MetaTileEntityLoader.java @@ -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());