From 4f6edf12a521bffea6b75b5189b64dfa378dde3f Mon Sep 17 00:00:00 2001 From: Toshayo Date: Wed, 27 Jul 2022 21:27:29 +0200 Subject: [PATCH 1/2] Change access modifier to satellite registration to allow custom satellites. --- .../com/hbm/saveddata/satellites/Satellite.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/hbm/saveddata/satellites/Satellite.java b/src/main/java/com/hbm/saveddata/satellites/Satellite.java index c552b802c..70c65e0ac 100644 --- a/src/main/java/com/hbm/saveddata/satellites/Satellite.java +++ b/src/main/java/com/hbm/saveddata/satellites/Satellite.java @@ -50,11 +50,17 @@ public abstract class Satellite { registerSatellite(SatelliteLunarMiner.class, ModItems.sat_lunar_miner); registerSatellite(SatelliteHorizons.class, ModItems.sat_gerald); } - - private static void registerSatellite(Class sat, Item item) { - satellites.add(sat); - itemToClass.put(item, sat); + /** + * Register satellite. + * @param sat - Satellite class + * @param item - Satellite item (which will be placed in a rocket) + */ + public static void registerSatellite(Class sat, Item item) { + if(!itemToClass.containsKey(item) && !itemToClass.containsValue(sat)) { + satellites.add(sat); + itemToClass.put(item, sat); + } } public static void orbit(World world, int id, int freq, double x, double y, double z) { From ba2565733db565c1082aa5c7b4ac7d7559650c1d Mon Sep 17 00:00:00 2001 From: Toshayo Date: Thu, 28 Jul 2022 09:40:47 +0200 Subject: [PATCH 2/2] =?UTF-8?q?Add=20comments=20to=20config=20entries=20(i?= =?UTF-8?q?nstead=20of=20having=20those=20in=20pinned=20discord=20messages?= =?UTF-8?q?=20=C2=AF\=5F(=E3=83=84)=5F/=C2=AF)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/hbm/config/GeneralConfig.java | 42 +++++++++---------- src/main/java/com/hbm/config/ToolConfig.java | 20 ++++----- 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/src/main/java/com/hbm/config/GeneralConfig.java b/src/main/java/com/hbm/config/GeneralConfig.java index 44c05fa3c..21aa4c875 100644 --- a/src/main/java/com/hbm/config/GeneralConfig.java +++ b/src/main/java/com/hbm/config/GeneralConfig.java @@ -53,27 +53,27 @@ public class GeneralConfig { public static void loadFromConfig(Configuration config) { final String CATEGORY_GENERAL = CommonConfig.CATEGORY_GENERAL; - enableDebugMode = config.get(CATEGORY_GENERAL, "1.00_enableDebugMode", false).getBoolean(false); - enableMycelium = config.get(CATEGORY_GENERAL, "1.01_enableMyceliumSpread", false).getBoolean(false); - enablePlutoniumOre = config.get(CATEGORY_GENERAL, "1.02_enablePlutoniumNetherOre", false).getBoolean(false); - enableDungeons = config.get(CATEGORY_GENERAL, "1.03_enableDungeonSpawn", true).getBoolean(true); - enableMDOres = config.get(CATEGORY_GENERAL, "1.04_enableOresInModdedDimensions", true).getBoolean(true); - enableMines = config.get(CATEGORY_GENERAL, "1.05_enableLandmineSpawn", true).getBoolean(true); - enableRad = config.get(CATEGORY_GENERAL, "1.06_enableRadHotspotSpawn", true).getBoolean(true); - enableNITAN = config.get(CATEGORY_GENERAL, "1.07_enableNITANChestSpawn", true).getBoolean(true); - enableNukeClouds = config.get(CATEGORY_GENERAL, "1.08_enableMushroomClouds", true).getBoolean(true); - enableBomberShortMode = config.get(CATEGORY_GENERAL, "1.14_enableBomberShortMode", false).getBoolean(false); - enableVaults = config.get(CATEGORY_GENERAL, "1.15_enableVaultSpawn", true).getBoolean(true); - enableCataclysm = config.get(CATEGORY_GENERAL, "1.17_enableCataclysm", false).getBoolean(false); - enableExtendedLogging = config.get(CATEGORY_GENERAL, "1.18_enableExtendedLogging", false).getBoolean(false); - enableHardcoreTaint = config.get(CATEGORY_GENERAL, "1.19_enableHardcoreTaint", false).getBoolean(false); - enableGuns = config.get(CATEGORY_GENERAL, "1.20_enableGuns", true).getBoolean(true); - enableVirus = config.get(CATEGORY_GENERAL, "1.21_enableVirus", false).getBoolean(false); - enableCrosshairs = config.get(CATEGORY_GENERAL, "1.22_enableCrosshairs", true).getBoolean(true); - enableReflectorCompat = config.get(CATEGORY_GENERAL, "1.24_enableReflectorCompat", false).getBoolean(false); - enableRenderDistCheck = config.get(CATEGORY_GENERAL, "1.25_enableRenderDistCheck", true).getBoolean(true); - enableCustomDashKeybind = config.get(CATEGORY_GENERAL, "1.26_enableCustomDashKeybind", false).getBoolean(false); - enableReEval = config.get(CATEGORY_GENERAL, "1.27_enableReEval", true).getBoolean(true); + enableDebugMode = config.get(CATEGORY_GENERAL, "1.00_enableDebugMode", false, "Enable debugging mode").getBoolean(false); + enableMycelium = config.get(CATEGORY_GENERAL, "1.01_enableMyceliumSpread", false, "Allows mycelium to spread").getBoolean(false); + enablePlutoniumOre = config.get(CATEGORY_GENERAL, "1.02_enablePlutoniumNetherOre", false, "Enables plutonium ore generation in the nether").getBoolean(false); + enableDungeons = config.get(CATEGORY_GENERAL, "1.03_enableDungeonSpawn", true, "Allows custom generation like meteor dungeons and whatnot to spawn").getBoolean(true); + enableMDOres = config.get(CATEGORY_GENERAL, "1.04_enableOresInModdedDimensions", true, "Allows NTM ores to generate in modded dimensions").getBoolean(true); + enableMines = config.get(CATEGORY_GENERAL, "1.05_enableLandmineSpawn", true, "Allows landmines to generate").getBoolean(true); + enableRad = config.get(CATEGORY_GENERAL, "1.06_enableRadHotspotSpawn", true, "Allows radiation hotspots to generate").getBoolean(true); + enableNITAN = config.get(CATEGORY_GENERAL, "1.07_enableNITANChestSpawn", true, "Allows chests to spawn at specific coordinates full of powders").getBoolean(true); + enableNukeClouds = config.get(CATEGORY_GENERAL, "1.08_enableMushroomClouds", true, "Allow these green clouds after nuke explosions").getBoolean(true); + enableBomberShortMode = config.get(CATEGORY_GENERAL, "1.14_enableBomberShortMode", false, "Has bomber planes spawn in closer to the target for use with smaller render distances").getBoolean(false); + enableVaults = config.get(CATEGORY_GENERAL, "1.15_enableVaultSpawn", true, "Allows vaults to spawn").getBoolean(true); + enableCataclysm = config.get(CATEGORY_GENERAL, "1.17_enableCataclysm", false, "Causes satellites to fall whenever a mob dies").getBoolean(false); + enableExtendedLogging = config.get(CATEGORY_GENERAL, "1.18_enableExtendedLogging", false, "Allows logs about nuke, grenade explosions, detonators activated, missiles launched, etc.").getBoolean(false); + enableHardcoreTaint = config.get(CATEGORY_GENERAL, "1.19_enableHardcoreTaint", false, "Allows tainted mobs to spread taint").getBoolean(false); + enableGuns = config.get(CATEGORY_GENERAL, "1.20_enableGuns", true, "Allows guns to be obtainable").getBoolean(true); + enableVirus = config.get(CATEGORY_GENERAL, "1.21_enableVirus", false, "Allows virus blocks to spread").getBoolean(false); + enableCrosshairs = config.get(CATEGORY_GENERAL, "1.22_enableCrosshairs", true, "Shows custom crosshairs when an NTM gun is being held").getBoolean(true); + enableReflectorCompat = config.get(CATEGORY_GENERAL, "1.24_enableReflectorCompat", false, "Enable old reflector oredict name (\"plateDenseLead\") instead of new \"plateTungCar\"").getBoolean(false); + enableRenderDistCheck = config.get(CATEGORY_GENERAL, "1.25_enableRenderDistCheck", true, "Check invalid render distances (over 16, without OptiFine) and fix it").getBoolean(true); + enableCustomDashKeybind = config.get(CATEGORY_GENERAL, "1.26_enableCustomDashKeybind", false, "Enable custom dash keybind instead of shift").getBoolean(false); + enableReEval = config.get(CATEGORY_GENERAL, "1.27_enableReEval", true, "Allows re-evaluating power networks on link remove instead of destroying and recreating").getBoolean(true); hintPos = CommonConfig.createConfigInt(config, CATEGORY_GENERAL, "1.27_hudOverlayPosition", "0: Top left\n1: Top right\n2: Center right\n3: Center Left", 0); diff --git a/src/main/java/com/hbm/config/ToolConfig.java b/src/main/java/com/hbm/config/ToolConfig.java index fd03a0fe7..16ffc3216 100644 --- a/src/main/java/com/hbm/config/ToolConfig.java +++ b/src/main/java/com/hbm/config/ToolConfig.java @@ -26,15 +26,15 @@ public class ToolConfig { recursiveStone = CommonConfig.createConfigBool(config, CATEGORY_TOOLS, "11.01_recursionStone", "Determines whether veinminer can break stone", false); recursiveNetherrack = CommonConfig.createConfigBool(config, CATEGORY_TOOLS, "11.02_recursionNetherrack", "Determines whether veinminer can break netherrack", false); - abilityHammer = config.get(CATEGORY_TOOLS, "11.03_hammerAbility", true).getBoolean(true); - abilityVein = config.get(CATEGORY_TOOLS, "11.04_abilityVein", true).getBoolean(true); - abilityLuck = config.get(CATEGORY_TOOLS, "11.05_abilityLuck", true).getBoolean(true); - abilitySilk = config.get(CATEGORY_TOOLS, "11.06_abilitySilk", true).getBoolean(true); - abilityFurnace = config.get(CATEGORY_TOOLS, "11.07_abilityFurnace", true).getBoolean(true); - abilityShredder = config.get(CATEGORY_TOOLS, "11.08_abilityShredder", true).getBoolean(true); - abilityCentrifuge = config.get(CATEGORY_TOOLS, "11.09_abilityCentrifuge", true).getBoolean(true); - abilityCrystallizer = config.get(CATEGORY_TOOLS, "11.10_abilityCrystallizer", true).getBoolean(true); - abilityMercury = config.get(CATEGORY_TOOLS, "11.11_abilityMercury", true).getBoolean(true); - abilityExplosion = config.get(CATEGORY_TOOLS, "11.12_abilityExplosion", true).getBoolean(true); + abilityHammer = config.get(CATEGORY_TOOLS, "11.03_hammerAbility", true, "Allows AoE ability").getBoolean(true); + abilityVein = config.get(CATEGORY_TOOLS, "11.04_abilityVein", true, "Allows veinminer ability").getBoolean(true); + abilityLuck = config.get(CATEGORY_TOOLS, "11.05_abilityLuck", true, "Allow luck (fortune) ability").getBoolean(true); + abilitySilk = config.get(CATEGORY_TOOLS, "11.06_abilitySilk", true, "Allow silk touch ability").getBoolean(true); + abilityFurnace = config.get(CATEGORY_TOOLS, "11.07_abilityFurnace", true, "Allow auto-smelter ability").getBoolean(true); + abilityShredder = config.get(CATEGORY_TOOLS, "11.08_abilityShredder", true, "Allow auto-shredder ability").getBoolean(true); + abilityCentrifuge = config.get(CATEGORY_TOOLS, "11.09_abilityCentrifuge", true, "Allow auto-centrifuge ability").getBoolean(true); + abilityCrystallizer = config.get(CATEGORY_TOOLS, "11.10_abilityCrystallizer", true, "Allow auto-crystallizer ability").getBoolean(true); + abilityMercury = config.get(CATEGORY_TOOLS, "11.11_abilityMercury", true, "Allow mercury touch ability (digging redstone gives mercury)").getBoolean(true); + abilityExplosion = config.get(CATEGORY_TOOLS, "11.12_abilityExplosion", true, "Allow explosion ability").getBoolean(true); } }