From a831c2ada3d70422cd8286e3c887531f6dbb32d0 Mon Sep 17 00:00:00 2001 From: Electroblob77 <35599699+Electroblob77@users.noreply.github.com> Date: Wed, 15 Jul 2020 00:30:08 +0100 Subject: [PATCH] Separate surface and underground library marker options --- src/main/java/electroblob/wizardry/Settings.java | 10 ++++++++++ .../antiqueatlas/WizardryAntiqueAtlasIntegration.java | 4 ++-- .../wizardry/worldgen/WorldGenLibraryRuins.java | 2 +- .../worldgen/WorldGenUndergroundLibraryRuins.java | 2 +- src/main/resources/assets/ebwizardry/lang/en_gb.lang | 4 +++- src/main/resources/assets/ebwizardry/lang/en_us.lang | 4 +++- 6 files changed, 20 insertions(+), 6 deletions(-) diff --git a/src/main/java/electroblob/wizardry/Settings.java b/src/main/java/electroblob/wizardry/Settings.java index 054eeb83..8827e6e4 100644 --- a/src/main/java/electroblob/wizardry/Settings.java +++ b/src/main/java/electroblob/wizardry/Settings.java @@ -277,6 +277,8 @@ public final class Settings { public boolean autoShrineMarkers = true; /** [Server-only] Whether global markers for library ruins are added to antique atlases. */ public boolean autoLibraryMarkers = true; + /** [Server-only] Whether global markers for underground library ruins are added to antique atlases. */ + public boolean autoUndergroundLibraryMarkers = false; // Synchronised settings. These settings affect both client-side AND server-side code. Changing these locally // only has an effect if the local game is the host, i.e. a dedicated server, a LAN host or a singleplayer world. @@ -1286,6 +1288,14 @@ public final class Settings { autoLibraryMarkers = property.getBoolean(); propOrder.add(property.getName()); + property = config.get(COMPATIBILITY_CATEGORY, "autoPlaceUndergroundLibraryMarkers", false, + "Controls whether wizardry automatically places antique atlas markers at the locations of underground library ruins."); + property.setLanguageKey("config." + Wizardry.MODID + ".auto_place_underground_library_markers"); + property.setRequiresMcRestart(true); + Wizardry.proxy.setToNamedBooleanEntry(property); + autoUndergroundLibraryMarkers = property.getBoolean(); + propOrder.add(property.getName()); + config.setCategoryPropertyOrder(COMPATIBILITY_CATEGORY, propOrder); } diff --git a/src/main/java/electroblob/wizardry/integration/antiqueatlas/WizardryAntiqueAtlasIntegration.java b/src/main/java/electroblob/wizardry/integration/antiqueatlas/WizardryAntiqueAtlasIntegration.java index d2341f9c..a85d71ab 100644 --- a/src/main/java/electroblob/wizardry/integration/antiqueatlas/WizardryAntiqueAtlasIntegration.java +++ b/src/main/java/electroblob/wizardry/integration/antiqueatlas/WizardryAntiqueAtlasIntegration.java @@ -68,8 +68,8 @@ public class WizardryAntiqueAtlasIntegration { /** Places a global library ruins marker in all antique atlases at the given coordinates in the given world if * {@link electroblob.wizardry.Settings#autoLibraryMarkers} is enabled. Server side only! */ - public static void markLibrary(World world, int x, int z){ - if(enabled() && Wizardry.settings.autoLibraryMarkers){ // TODO: More granular settings for above/below ground + public static void markLibrary(World world, int x, int z, boolean underground){ + if(enabled() && (underground ? Wizardry.settings.autoUndergroundLibraryMarkers : Wizardry.settings.autoLibraryMarkers)){ AtlasAPI.getMarkerAPI().putGlobalMarker(world, false, LIBRARY_MARKER.toString(), "integration.antiqueatlas.marker." + LIBRARY_MARKER.toString().replace(':', '.'), x, z); } } diff --git a/src/main/java/electroblob/wizardry/worldgen/WorldGenLibraryRuins.java b/src/main/java/electroblob/wizardry/worldgen/WorldGenLibraryRuins.java index 4243b0f1..9a854b6b 100644 --- a/src/main/java/electroblob/wizardry/worldgen/WorldGenLibraryRuins.java +++ b/src/main/java/electroblob/wizardry/worldgen/WorldGenLibraryRuins.java @@ -94,7 +94,7 @@ public class WorldGenLibraryRuins extends WorldGenSurfaceStructure { template.addBlocksToWorld(world, origin, processor, settings, 2 | 16); - WizardryAntiqueAtlasIntegration.markLibrary(world, origin.getX(), origin.getZ()); + WizardryAntiqueAtlasIntegration.markLibrary(world, origin.getX(), origin.getZ(), false); } } diff --git a/src/main/java/electroblob/wizardry/worldgen/WorldGenUndergroundLibraryRuins.java b/src/main/java/electroblob/wizardry/worldgen/WorldGenUndergroundLibraryRuins.java index 1338af36..14730ed8 100644 --- a/src/main/java/electroblob/wizardry/worldgen/WorldGenUndergroundLibraryRuins.java +++ b/src/main/java/electroblob/wizardry/worldgen/WorldGenUndergroundLibraryRuins.java @@ -98,7 +98,7 @@ public class WorldGenUndergroundLibraryRuins extends WorldGenUndergroundStructur template.addBlocksToWorld(world, origin, processor, settings, 2 | 16); - WizardryAntiqueAtlasIntegration.markLibrary(world, origin.getX(), origin.getZ()); + WizardryAntiqueAtlasIntegration.markLibrary(world, origin.getX(), origin.getZ(), true); } } diff --git a/src/main/resources/assets/ebwizardry/lang/en_gb.lang b/src/main/resources/assets/ebwizardry/lang/en_gb.lang index 752e8f75..04b81cf5 100644 --- a/src/main/resources/assets/ebwizardry/lang/en_gb.lang +++ b/src/main/resources/assets/ebwizardry/lang/en_gb.lang @@ -1560,7 +1560,9 @@ config.ebwizardry.auto_place_obelisk_markers.tooltip=Controls whether wizardry a config.ebwizardry.auto_place_shrine_markers=Auto-Place Shrine Markers config.ebwizardry.auto_place_shrine_markers.tooltip=Controls whether wizardry automatically places antique atlas markers at the locations of shrines. config.ebwizardry.auto_place_library_markers=Auto-Place Library Markers -config.ebwizardry.auto_place_library_markers.tooltip=Controls whether wizardry automatically places antique atlas markers at the locations of library ruins. +config.ebwizardry.auto_place_library_markers.tooltip=Controls whether wizardry automatically places antique atlas markers at the locations of surface library ruins. +config.ebwizardry.auto_place_underground_library_markers=Auto-Place Underground Library Markers +config.ebwizardry.auto_place_underground_library_markers.tooltip=Controls whether wizardry automatically places antique atlas markers at the locations of underground library ruins. integration.jei.category.ebwizardry\:arcane_workbench=Arcane Workbench diff --git a/src/main/resources/assets/ebwizardry/lang/en_us.lang b/src/main/resources/assets/ebwizardry/lang/en_us.lang index f14414dc..22b419d7 100644 --- a/src/main/resources/assets/ebwizardry/lang/en_us.lang +++ b/src/main/resources/assets/ebwizardry/lang/en_us.lang @@ -1560,7 +1560,9 @@ config.ebwizardry.auto_place_obelisk_markers.tooltip=Controls whether wizardry a config.ebwizardry.auto_place_shrine_markers=Auto-Place Shrine Markers config.ebwizardry.auto_place_shrine_markers.tooltip=Controls whether wizardry automatically places antique atlas markers at the locations of shrines. config.ebwizardry.auto_place_library_markers=Auto-Place Library Markers -config.ebwizardry.auto_place_library_markers.tooltip=Controls whether wizardry automatically places antique atlas markers at the locations of library ruins. +config.ebwizardry.auto_place_library_markers.tooltip=Controls whether wizardry automatically places antique atlas markers at the locations of surface library ruins. +config.ebwizardry.auto_place_underground_library_markers=Auto-Place Underground Library Markers +config.ebwizardry.auto_place_underground_library_markers.tooltip=Controls whether wizardry automatically places antique atlas markers at the locations of underground library ruins. integration.jei.category.ebwizardry\:arcane_workbench=Arcane Workbench