From fd45b701225afeebff433876fea91b2695b4764b Mon Sep 17 00:00:00 2001 From: omergunr100 Date: Sun, 29 Dec 2024 18:37:55 +0200 Subject: [PATCH] add option to turn off specific map mod integrations --- .../resources/assets/gtceu/lang/en_ud.json | 4 ++++ .../resources/assets/gtceu/lang/en_us.json | 4 ++++ .../gregtechceu/gtceu/client/ClientProxy.java | 5 +++-- .../gtceu/config/ConfigHolder.java | 21 ++++++++++++++++++- .../mixins/ftbchunks/LargeMapScreenMixin.java | 3 +++ .../mixins/ftbchunks/RegionMapPanelMixin.java | 3 +++ .../mixins/journeymap/FullscreenMixin.java | 2 ++ .../HighlighterRegistryMixin.java | 2 ++ .../xaerominimap/MinimapFBORendererMixin.java | 2 ++ .../mixins/xaeroworldmap/GuiMapMixin.java | 1 + .../MapElementRenderHandlerBuilderMixin.java | 5 ++++- .../xaeroworldmap/WorldMapSessionMixin.java | 2 ++ .../integration/map/GroupingMapRenderer.java | 8 ++++--- .../integration/map/WaypointManager.java | 8 ++++--- .../map/xaeros/XaerosMapPlugin.java | 4 +++- 15 files changed, 63 insertions(+), 11 deletions(-) diff --git a/src/generated/resources/assets/gtceu/lang/en_ud.json b/src/generated/resources/assets/gtceu/lang/en_ud.json index 5e9b4223ee..58806a4e9d 100644 --- a/src/generated/resources/assets/gtceu/lang/en_ud.json +++ b/src/generated/resources/assets/gtceu/lang/en_ud.json @@ -1724,6 +1724,7 @@ "config.gtceu.option.bronzeBoilerMaxTemperature": "ǝɹnʇɐɹǝdɯǝ⟘xɐWɹǝןıoᗺǝzuoɹq", "config.gtceu.option.buttonAnchor": "ɹoɥɔuⱯuoʇʇnq", "config.gtceu.option.casingsPerCraft": "ʇɟɐɹƆɹǝԀsbuısɐɔ", + "config.gtceu.option.chunksIntegration": "uoıʇɐɹbǝʇuIsʞunɥɔ", "config.gtceu.option.cleanMultiblocks": "sʞɔoןqıʇןnWuɐǝןɔ", "config.gtceu.option.client": "ʇuǝıןɔ", "config.gtceu.option.compat": "ʇɐdɯoɔ", @@ -1786,6 +1787,7 @@ "config.gtceu.option.inWorldPreviewDuration": "uoıʇɐɹnᗡʍǝıʌǝɹԀpןɹoMuı", "config.gtceu.option.increaseDungeonLoot": "ʇooꞀuoǝbunᗡǝsɐǝɹɔuı", "config.gtceu.option.infiniteBedrockOresFluids": "spınןℲsǝɹOʞɔoɹpǝᗺǝʇıuıɟuı", + "config.gtceu.option.journeyMapIntegration": "uoıʇɐɹbǝʇuIdɐWʎǝuɹnoظ", "config.gtceu.option.largeBoilers": "sɹǝןıoᗺǝbɹɐן", "config.gtceu.option.ldFluidPipeMinDistance": "ǝɔuɐʇsıᗡuıWǝdıԀpınןℲpן", "config.gtceu.option.ldItemPipeMinDistance": "ǝɔuɐʇsıᗡuıWǝdıԀɯǝʇIpן", @@ -1845,6 +1847,7 @@ "config.gtceu.option.surfaceRockProspectRange": "ǝbuɐᴚʇɔǝdsoɹԀʞɔoᴚǝɔɐɟɹns", "config.gtceu.option.titaniumBoilerHeatSpeed": "pǝǝdSʇɐǝHɹǝןıoᗺɯnıuɐʇıʇ", "config.gtceu.option.titaniumBoilerMaxTemperature": "ǝɹnʇɐɹǝdɯǝ⟘xɐWɹǝןıoᗺɯnıuɐʇıʇ", + "config.gtceu.option.toggle": "ǝןbboʇ", "config.gtceu.option.toolCraftingSounds": "spunoSbuıʇɟɐɹƆןooʇ", "config.gtceu.option.toolUseSounds": "spunoSǝs∩ןooʇ", "config.gtceu.option.tools": "sןooʇ", @@ -1864,6 +1867,7 @@ "config.gtceu.option.worldAcceleratorBlacklist": "ʇsıןʞɔɐןᗺɹoʇɐɹǝןǝɔɔⱯpןɹoʍ", "config.gtceu.option.worldgen": "uǝbpןɹoʍ", "config.gtceu.option.xOffset": "ʇǝsɟɟOx", + "config.gtceu.option.xaeroxMapIntegration": "uoıʇɐɹbǝʇuIdɐWxoɹǝɐx", "config.gtceu.option.yOffset": "ʇǝsɟɟOʎ", "config.gtceu.option.zombieSpawnWithSabers": "sɹǝqɐSɥʇıMuʍɐdSǝıqɯoz", "config.jade.plugin_gtceu.auto_output_info": "oɟuI ʇndʇnO oʇnⱯ ]nƎƆ⟘⅁[", diff --git a/src/generated/resources/assets/gtceu/lang/en_us.json b/src/generated/resources/assets/gtceu/lang/en_us.json index fbdcab66be..c2d72c7b47 100644 --- a/src/generated/resources/assets/gtceu/lang/en_us.json +++ b/src/generated/resources/assets/gtceu/lang/en_us.json @@ -1724,6 +1724,7 @@ "config.gtceu.option.bronzeBoilerMaxTemperature": "bronzeBoilerMaxTemperature", "config.gtceu.option.buttonAnchor": "buttonAnchor", "config.gtceu.option.casingsPerCraft": "casingsPerCraft", + "config.gtceu.option.chunksIntegration": "chunksIntegration", "config.gtceu.option.cleanMultiblocks": "cleanMultiblocks", "config.gtceu.option.client": "client", "config.gtceu.option.compat": "compat", @@ -1786,6 +1787,7 @@ "config.gtceu.option.inWorldPreviewDuration": "inWorldPreviewDuration", "config.gtceu.option.increaseDungeonLoot": "increaseDungeonLoot", "config.gtceu.option.infiniteBedrockOresFluids": "infiniteBedrockOresFluids", + "config.gtceu.option.journeyMapIntegration": "journeyMapIntegration", "config.gtceu.option.largeBoilers": "largeBoilers", "config.gtceu.option.ldFluidPipeMinDistance": "ldFluidPipeMinDistance", "config.gtceu.option.ldItemPipeMinDistance": "ldItemPipeMinDistance", @@ -1845,6 +1847,7 @@ "config.gtceu.option.surfaceRockProspectRange": "surfaceRockProspectRange", "config.gtceu.option.titaniumBoilerHeatSpeed": "titaniumBoilerHeatSpeed", "config.gtceu.option.titaniumBoilerMaxTemperature": "titaniumBoilerMaxTemperature", + "config.gtceu.option.toggle": "toggle", "config.gtceu.option.toolCraftingSounds": "toolCraftingSounds", "config.gtceu.option.toolUseSounds": "toolUseSounds", "config.gtceu.option.tools": "tools", @@ -1864,6 +1867,7 @@ "config.gtceu.option.worldAcceleratorBlacklist": "worldAcceleratorBlacklist", "config.gtceu.option.worldgen": "worldgen", "config.gtceu.option.xOffset": "xOffset", + "config.gtceu.option.xaeroxMapIntegration": "xaeroxMapIntegration", "config.gtceu.option.yOffset": "yOffset", "config.gtceu.option.zombieSpawnWithSabers": "zombieSpawnWithSabers", "config.jade.plugin_gtceu.auto_output_info": "[GTCEu] Auto Output Info", diff --git a/src/main/java/com/gregtechceu/gtceu/client/ClientProxy.java b/src/main/java/com/gregtechceu/gtceu/client/ClientProxy.java index f3e02af11d..999fe4f28e 100644 --- a/src/main/java/com/gregtechceu/gtceu/client/ClientProxy.java +++ b/src/main/java/com/gregtechceu/gtceu/client/ClientProxy.java @@ -12,6 +12,7 @@ import com.gregtechceu.gtceu.common.data.GTEntityTypes; import com.gregtechceu.gtceu.common.data.GTParticleTypes; import com.gregtechceu.gtceu.common.entity.GTBoat; +import com.gregtechceu.gtceu.config.ConfigHolder; import com.gregtechceu.gtceu.integration.map.ClientCacheManager; import com.gregtechceu.gtceu.integration.map.cache.client.GTClientCache; import com.gregtechceu.gtceu.integration.map.ftbchunks.FTBChunksPlugin; @@ -20,7 +21,6 @@ import com.gregtechceu.gtceu.integration.map.layer.builtin.OreRenderLayer; import com.gregtechceu.gtceu.utils.input.KeyBind; -import com.lowdragmc.lowdraglib.LDLib; import com.lowdragmc.lowdraglib.Platform; import net.minecraft.client.model.BoatModel; @@ -100,7 +100,8 @@ public void onRegisterParticleProviders(RegisterParticleProvidersEvent event) { @SubscribeEvent public void onClientSetup(FMLClientSetupEvent event) { - if (LDLib.isModLoaded(GTValues.MODID_FTB_CHUNKS)) { + if (ConfigHolder.INSTANCE.compat.minimap.toggle.chunksIntegration && + Platform.isModLoaded(GTValues.MODID_FTB_CHUNKS)) { FTBChunksPlugin.addEventListeners(); } } diff --git a/src/main/java/com/gregtechceu/gtceu/config/ConfigHolder.java b/src/main/java/com/gregtechceu/gtceu/config/ConfigHolder.java index 8482db4642..f42bcc5ff9 100644 --- a/src/main/java/com/gregtechceu/gtceu/config/ConfigHolder.java +++ b/src/main/java/com/gregtechceu/gtceu/config/ConfigHolder.java @@ -211,12 +211,16 @@ public static class AE2CompatConfig { public static class MinimapCompatConfig { + @Configurable + @Configurable.Comment({ + "Toggle specific map mod integration on/off (need to restart for this to take effect)" }) + public Toggle toggle = new Toggle(); + @Configurable @Configurable.Comment({ "The radius, in blocks, that picking up a surface rock will search for veins in.", "-1 to disable.", "Default: 24" }) @Configurable.Range(min = 1) public int surfaceRockProspectRange = 24; - @Configurable @Configurable.Comment({ "The radius, in blocks, that clicking an ore block will search for veins in.", "-1 to disable", "Default: 24" }) @@ -264,6 +268,21 @@ public static class MinimapCompatConfig { "Default: true" }) public boolean rightToolbar = true; + public static class Toggle { + + @Configurable + @Configurable.Comment({ "FTB Chunks integration enabled" }) + public boolean chunksIntegration = false; + + @Configurable + @Configurable.Comment({ "Journey Map integration enabled" }) + public boolean journeyMapIntegration = true; + + @Configurable + @Configurable.Comment({ "Xaerox's map integration enabled" }) + public boolean xaeroxMapIntegration = true; + } + public enum Anchor { TOP_LEFT, diff --git a/src/main/java/com/gregtechceu/gtceu/core/mixins/ftbchunks/LargeMapScreenMixin.java b/src/main/java/com/gregtechceu/gtceu/core/mixins/ftbchunks/LargeMapScreenMixin.java index 92d1eaa02b..8985f82ae2 100644 --- a/src/main/java/com/gregtechceu/gtceu/core/mixins/ftbchunks/LargeMapScreenMixin.java +++ b/src/main/java/com/gregtechceu/gtceu/core/mixins/ftbchunks/LargeMapScreenMixin.java @@ -1,5 +1,6 @@ package com.gregtechceu.gtceu.core.mixins.ftbchunks; +import com.gregtechceu.gtceu.config.ConfigHolder; import com.gregtechceu.gtceu.integration.map.ButtonState; import com.gregtechceu.gtceu.integration.map.ftbchunks.FTBChunksOptions; @@ -30,6 +31,7 @@ public abstract class LargeMapScreenMixin extends BaseScreen { @Inject(method = "addWidgets", at = @At(value = "TAIL")) private void gtceu$injectAddWidgets(CallbackInfo ci) { + if (!ConfigHolder.INSTANCE.compat.minimap.toggle.chunksIntegration) return; gtceu$injectedWidgets.clear(); var prefix = "gtceu.button."; for (var button : ButtonState.getAllButtons()) { @@ -63,6 +65,7 @@ public void addMouseOverText(TooltipList list) { @Inject(method = "alignWidgets", at = @At(value = "TAIL")) private void gtceu$injectAlignWidgets(CallbackInfo ci) { + if (!ConfigHolder.INSTANCE.compat.minimap.toggle.chunksIntegration) return; var buttonCount = gtceu$injectedWidgets.size(); var startHeight = (height - buttonCount * 18) / 2; for (int i = 0; i < buttonCount; i++) { diff --git a/src/main/java/com/gregtechceu/gtceu/core/mixins/ftbchunks/RegionMapPanelMixin.java b/src/main/java/com/gregtechceu/gtceu/core/mixins/ftbchunks/RegionMapPanelMixin.java index 6be082fc71..6bceb5ec93 100644 --- a/src/main/java/com/gregtechceu/gtceu/core/mixins/ftbchunks/RegionMapPanelMixin.java +++ b/src/main/java/com/gregtechceu/gtceu/core/mixins/ftbchunks/RegionMapPanelMixin.java @@ -1,5 +1,6 @@ package com.gregtechceu.gtceu.core.mixins.ftbchunks; +import com.gregtechceu.gtceu.config.ConfigHolder; import com.gregtechceu.gtceu.integration.map.ftbchunks.FTBChunksOptions; import com.gregtechceu.gtceu.integration.map.ftbchunks.FTBChunksRenderer; import com.gregtechceu.gtceu.integration.map.ftbchunks.veins.fluid.FluidVeinIcon; @@ -36,6 +37,7 @@ public RegionMapPanelMixin(Panel panel) { @Inject(method = "addWidgets", at = @At(value = "INVOKE", target = "Ldev/ftb/mods/ftbchunks/client/gui/RegionMapPanel;alignWidgets()V")) private void gtceu$injectAddWidgets(CallbackInfo ci) { + if (!ConfigHolder.INSTANCE.compat.minimap.toggle.chunksIntegration) return; if (FTBChunksOptions.showLayer("bedrock_fluids")) { FTBChunksRenderer.fluidElements.row(largeMap.currentDimension()).forEach((pos, icon) -> { var widget = new FluidVeinWidget((RegionMapPanel) (Object) this, icon); @@ -46,6 +48,7 @@ public RegionMapPanelMixin(Panel panel) { @Inject(method = "alignWidgets", at = @At(value = "TAIL")) private void gtceu$injectAlignWidgets(CallbackInfo ci) { + if (!ConfigHolder.INSTANCE.compat.minimap.toggle.chunksIntegration) return; var regionSize = largeMap.getRegionTileSize(); var chunkSize = largeMap.getRegionTileSize() / 32; for (var widget : widgets) { diff --git a/src/main/java/com/gregtechceu/gtceu/core/mixins/journeymap/FullscreenMixin.java b/src/main/java/com/gregtechceu/gtceu/core/mixins/journeymap/FullscreenMixin.java index 807370ee3c..09ffaf5637 100644 --- a/src/main/java/com/gregtechceu/gtceu/core/mixins/journeymap/FullscreenMixin.java +++ b/src/main/java/com/gregtechceu/gtceu/core/mixins/journeymap/FullscreenMixin.java @@ -44,6 +44,7 @@ public FullscreenMixin(String title) { shift = At.Shift.AFTER), remap = false) private void gtceu$injectInitButtons(CallbackInfo ci) { + if (!ConfigHolder.INSTANCE.compat.minimap.toggle.journeyMapIntegration) return; final Theme theme = ThemeLoader.getCurrentTheme(); gtceu$buttons = new LinkedHashMap<>(); @@ -79,6 +80,7 @@ public FullscreenMixin(String title) { @Inject(method = "layoutButtons", at = @At("TAIL"), remap = false) private void gtceu$injectLayoutButtons(CallbackInfo ci) { + if (!ConfigHolder.INSTANCE.compat.minimap.toggle.journeyMapIntegration) return; for (String buttonName : gtceu$buttons.keySet()) { gtceu$buttons.get(buttonName).setToggled(ButtonState.isEnabled(buttonName), false); } diff --git a/src/main/java/com/gregtechceu/gtceu/core/mixins/xaerominimap/HighlighterRegistryMixin.java b/src/main/java/com/gregtechceu/gtceu/core/mixins/xaerominimap/HighlighterRegistryMixin.java index 6584b3a337..6909dcd3dd 100644 --- a/src/main/java/com/gregtechceu/gtceu/core/mixins/xaerominimap/HighlighterRegistryMixin.java +++ b/src/main/java/com/gregtechceu/gtceu/core/mixins/xaerominimap/HighlighterRegistryMixin.java @@ -1,5 +1,6 @@ package com.gregtechceu.gtceu.core.mixins.xaerominimap; +import com.gregtechceu.gtceu.config.ConfigHolder; import com.gregtechceu.gtceu.integration.map.xaeros.minimap.fluid.FluidChunkHighlighter; import org.spongepowered.asm.mixin.Mixin; @@ -19,6 +20,7 @@ public abstract class HighlighterRegistryMixin { @Inject(method = "", at = @At("TAIL")) private void gtceu$registerHighlighters(CallbackInfo ci) { + if (!ConfigHolder.INSTANCE.compat.minimap.toggle.xaeroxMapIntegration) return; this.register(new FluidChunkHighlighter()); } } diff --git a/src/main/java/com/gregtechceu/gtceu/core/mixins/xaerominimap/MinimapFBORendererMixin.java b/src/main/java/com/gregtechceu/gtceu/core/mixins/xaerominimap/MinimapFBORendererMixin.java index f0b6cb5d4e..afdbcfd452 100644 --- a/src/main/java/com/gregtechceu/gtceu/core/mixins/xaerominimap/MinimapFBORendererMixin.java +++ b/src/main/java/com/gregtechceu/gtceu/core/mixins/xaerominimap/MinimapFBORendererMixin.java @@ -1,5 +1,6 @@ package com.gregtechceu.gtceu.core.mixins.xaerominimap; +import com.gregtechceu.gtceu.config.ConfigHolder; import com.gregtechceu.gtceu.integration.map.xaeros.minimap.ore.OreVeinElementRenderer; import net.minecraft.client.Minecraft; @@ -37,6 +38,7 @@ public MinimapFBORendererMixin(IXaeroMinimap modMain, Minecraft mc, WaypointsGui @Inject(method = "loadFrameBuffer", at = @At(value = "INVOKE", target = "Lxaero/common/mods/SupportMods;worldmap()Z")) private void gtceu$injectProspectionMarkers(MinimapProcessor minimapProcessor, CallbackInfo ci) { + if (!ConfigHolder.INSTANCE.compat.minimap.toggle.xaeroxMapIntegration) return; this.gtceu$oreVeinElementRenderer = OreVeinElementRenderer.Builder.begin().build(); minimapElementMapRendererHandler.add(this.gtceu$oreVeinElementRenderer); this.minimap.getOverMapRendererHandler().add(this.gtceu$oreVeinElementRenderer); diff --git a/src/main/java/com/gregtechceu/gtceu/core/mixins/xaeroworldmap/GuiMapMixin.java b/src/main/java/com/gregtechceu/gtceu/core/mixins/xaeroworldmap/GuiMapMixin.java index c8802bd15f..b1503246d6 100644 --- a/src/main/java/com/gregtechceu/gtceu/core/mixins/xaeroworldmap/GuiMapMixin.java +++ b/src/main/java/com/gregtechceu/gtceu/core/mixins/xaeroworldmap/GuiMapMixin.java @@ -33,6 +33,7 @@ protected GuiMapMixin(Screen parent, Screen escape, MapProcessor mapProcessor, E @Inject(method = "init", at = @At("TAIL"), remap = true) private void gtceu$injectInitGui(CallbackInfo ci) { + if (!ConfigHolder.INSTANCE.compat.minimap.toggle.xaeroxMapIntegration) return; int startX, startY, xOffset, yOffset; switch (ConfigHolder.INSTANCE.compat.minimap.direction) { diff --git a/src/main/java/com/gregtechceu/gtceu/core/mixins/xaeroworldmap/MapElementRenderHandlerBuilderMixin.java b/src/main/java/com/gregtechceu/gtceu/core/mixins/xaeroworldmap/MapElementRenderHandlerBuilderMixin.java index fcf70ddea4..27456cc533 100644 --- a/src/main/java/com/gregtechceu/gtceu/core/mixins/xaeroworldmap/MapElementRenderHandlerBuilderMixin.java +++ b/src/main/java/com/gregtechceu/gtceu/core/mixins/xaeroworldmap/MapElementRenderHandlerBuilderMixin.java @@ -1,5 +1,6 @@ package com.gregtechceu.gtceu.core.mixins.xaeroworldmap; +import com.gregtechceu.gtceu.config.ConfigHolder; import com.gregtechceu.gtceu.integration.map.xaeros.worldmap.ore.OreVeinElementRenderer; import org.spongepowered.asm.mixin.Mixin; @@ -15,7 +16,9 @@ public class MapElementRenderHandlerBuilderMixin { @ModifyVariable(method = "build", at = @At(value = "LOAD", ordinal = 3)) private List> gtceu$addOreRenderer(List> value) { - value.add(OreVeinElementRenderer.Builder.begin().build()); + if (ConfigHolder.INSTANCE.compat.minimap.toggle.xaeroxMapIntegration) { + value.add(OreVeinElementRenderer.Builder.begin().build()); + } return value; } } diff --git a/src/main/java/com/gregtechceu/gtceu/core/mixins/xaeroworldmap/WorldMapSessionMixin.java b/src/main/java/com/gregtechceu/gtceu/core/mixins/xaeroworldmap/WorldMapSessionMixin.java index 76bedfc4b5..5b3297bc6e 100644 --- a/src/main/java/com/gregtechceu/gtceu/core/mixins/xaeroworldmap/WorldMapSessionMixin.java +++ b/src/main/java/com/gregtechceu/gtceu/core/mixins/xaeroworldmap/WorldMapSessionMixin.java @@ -1,5 +1,6 @@ package com.gregtechceu.gtceu.core.mixins.xaeroworldmap; +import com.gregtechceu.gtceu.config.ConfigHolder; import com.gregtechceu.gtceu.integration.map.xaeros.worldmap.fluid.FluidChunkHighlighter; import net.minecraft.client.multiplayer.ClientPacketListener; @@ -23,6 +24,7 @@ public abstract class WorldMapSessionMixin { locals = LocalCapture.CAPTURE_FAILSOFT) private void cadmus$registerHighlighters(ClientPacketListener connection, long biomeZoomSeed, CallbackInfo ci, @Local HighlighterRegistry highlightRegistry) { + if (!ConfigHolder.INSTANCE.compat.minimap.toggle.xaeroxMapIntegration) return; highlightRegistry.register(new FluidChunkHighlighter()); } } diff --git a/src/main/java/com/gregtechceu/gtceu/integration/map/GroupingMapRenderer.java b/src/main/java/com/gregtechceu/gtceu/integration/map/GroupingMapRenderer.java index 2e3602c0d1..69319907fd 100644 --- a/src/main/java/com/gregtechceu/gtceu/integration/map/GroupingMapRenderer.java +++ b/src/main/java/com/gregtechceu/gtceu/integration/map/GroupingMapRenderer.java @@ -3,6 +3,7 @@ import com.gregtechceu.gtceu.api.GTValues; import com.gregtechceu.gtceu.api.data.worldgen.ores.GeneratedVeinMetadata; import com.gregtechceu.gtceu.api.gui.misc.ProspectorMode; +import com.gregtechceu.gtceu.config.ConfigHolder; import com.gregtechceu.gtceu.integration.map.ftbchunks.FTBChunksRenderer; import com.gregtechceu.gtceu.integration.map.journeymap.JourneymapRenderer; import com.gregtechceu.gtceu.integration.map.xaeros.XaerosRenderer; @@ -28,13 +29,14 @@ public class GroupingMapRenderer extends GenericMapRenderer { static { Map renderers = new HashMap<>(); - if (Platform.isModLoaded(GTValues.MODID_JOURNEYMAP)) { + var toggle = ConfigHolder.INSTANCE.compat.minimap.toggle; + if (toggle.journeyMapIntegration && Platform.isModLoaded(GTValues.MODID_JOURNEYMAP)) { renderers.put(GTValues.MODID_JOURNEYMAP, new JourneymapRenderer()); } - if (Platform.isModLoaded(GTValues.MODID_XAEROS_MINIMAP)) { + if (toggle.xaeroxMapIntegration && Platform.isModLoaded(GTValues.MODID_XAEROS_MINIMAP)) { renderers.put(GTValues.MODID_XAEROS_MINIMAP, new XaerosRenderer()); } - if (Platform.isModLoaded(GTValues.MODID_FTB_CHUNKS)) { + if (toggle.chunksIntegration && Platform.isModLoaded(GTValues.MODID_FTB_CHUNKS)) { renderers.put(GTValues.MODID_FTB_CHUNKS, new FTBChunksRenderer()); } diff --git a/src/main/java/com/gregtechceu/gtceu/integration/map/WaypointManager.java b/src/main/java/com/gregtechceu/gtceu/integration/map/WaypointManager.java index 9594f06b60..5ea7460a2b 100644 --- a/src/main/java/com/gregtechceu/gtceu/integration/map/WaypointManager.java +++ b/src/main/java/com/gregtechceu/gtceu/integration/map/WaypointManager.java @@ -1,6 +1,7 @@ package com.gregtechceu.gtceu.integration.map; import com.gregtechceu.gtceu.api.GTValues; +import com.gregtechceu.gtceu.config.ConfigHolder; import com.gregtechceu.gtceu.integration.map.ftbchunks.FTBChunksWaypointHandler; import com.gregtechceu.gtceu.integration.map.journeymap.JourneymapWaypointHandler; import com.gregtechceu.gtceu.integration.map.xaeros.XaeroWaypointHandler; @@ -28,15 +29,16 @@ public class WaypointManager { private static boolean active = false; public static void init() { - if (Platform.isModLoaded(GTValues.MODID_XAEROS_MINIMAP)) { + var toggle = ConfigHolder.INSTANCE.compat.minimap.toggle; + if (toggle.xaeroxMapIntegration && Platform.isModLoaded(GTValues.MODID_XAEROS_MINIMAP)) { WaypointManager.registerWaypointHandler(new XaeroWaypointHandler()); active = true; } - if (Platform.isModLoaded(GTValues.MODID_JOURNEYMAP)) { + if (toggle.journeyMapIntegration && Platform.isModLoaded(GTValues.MODID_JOURNEYMAP)) { WaypointManager.registerWaypointHandler(new JourneymapWaypointHandler()); active = true; } - if (Platform.isModLoaded(GTValues.MODID_FTB_CHUNKS)) { + if (toggle.chunksIntegration && Platform.isModLoaded(GTValues.MODID_FTB_CHUNKS)) { WaypointManager.registerWaypointHandler(new FTBChunksWaypointHandler()); active = true; } diff --git a/src/main/java/com/gregtechceu/gtceu/integration/map/xaeros/XaerosMapPlugin.java b/src/main/java/com/gregtechceu/gtceu/integration/map/xaeros/XaerosMapPlugin.java index ce0973e2ca..b99f2e07e0 100644 --- a/src/main/java/com/gregtechceu/gtceu/integration/map/xaeros/XaerosMapPlugin.java +++ b/src/main/java/com/gregtechceu/gtceu/integration/map/xaeros/XaerosMapPlugin.java @@ -1,6 +1,7 @@ package com.gregtechceu.gtceu.integration.map.xaeros; import com.gregtechceu.gtceu.api.GTValues; +import com.gregtechceu.gtceu.config.ConfigHolder; import com.lowdragmc.lowdraglib.Platform; @@ -32,7 +33,8 @@ public static void toggleOption(String name, boolean active) { dimHighlightHandler.requestRefresh(); } - if (Platform.isModLoaded(GTValues.MODID_XAEROS_WORLDMAP)) { + if (ConfigHolder.INSTANCE.compat.minimap.toggle.xaeroxMapIntegration && + Platform.isModLoaded(GTValues.MODID_XAEROS_WORLDMAP)) { WorldMapSession session = WorldMapSession.getCurrentSession(); MapWorld world = session.getMapProcessor().getMapWorld(); for (MapDimension mapDim : world.getDimensionsList()) {