diff options
author | olim <bobq4582@gmail.com> | 2024-05-06 15:04:07 +0100 |
---|---|---|
committer | olim <bobq4582@gmail.com> | 2024-05-09 22:59:29 +0100 |
commit | decdfbadbd3abd8bb4de617ef37add1dd03c8eee (patch) | |
tree | b804c066fadf5ab8421542f5dc957daaf9ebd49e /src/main/java/de/hysky/skyblocker/skyblock/dwarven/CommissionLabels.java | |
parent | 0cd6b2b3cbd9d86672030ab01772006b3f80d8fb (diff) | |
download | Skyblocker-decdfbadbd3abd8bb4de617ef37add1dd03c8eee.tar.gz Skyblocker-decdfbadbd3abd8bb4de617ef37add1dd03c8eee.tar.bz2 Skyblocker-decdfbadbd3abd8bb4de617ef37add1dd03c8eee.zip |
add config options
Diffstat (limited to 'src/main/java/de/hysky/skyblocker/skyblock/dwarven/CommissionLabels.java')
-rw-r--r-- | src/main/java/de/hysky/skyblocker/skyblock/dwarven/CommissionLabels.java | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/src/main/java/de/hysky/skyblocker/skyblock/dwarven/CommissionLabels.java b/src/main/java/de/hysky/skyblocker/skyblock/dwarven/CommissionLabels.java index 24b91780..9bdd2776 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/dwarven/CommissionLabels.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/dwarven/CommissionLabels.java @@ -1,10 +1,9 @@ package de.hysky.skyblocker.skyblock.dwarven; +import de.hysky.skyblocker.config.SkyblockerConfigManager; import de.hysky.skyblocker.utils.Utils; -import net.fabricmc.fabric.api.client.networking.v1.ClientPlayConnectionEvents; import net.fabricmc.fabric.api.client.rendering.v1.WorldRenderContext; import net.fabricmc.fabric.api.client.rendering.v1.WorldRenderEvents; -import net.minecraft.text.Text; import net.minecraft.util.math.BlockPos; import java.util.*; @@ -13,51 +12,57 @@ import java.util.stream.Collectors; public class CommissionLabels { - private static final Map<String, MiningLocationLabels.dwarvenCategory> DWARVEN_LOCATIONS = Arrays.stream(MiningLocationLabels.dwarvenCategory.values()).collect(Collectors.toMap(MiningLocationLabels.dwarvenCategory::toString, Function.identity())); - private static final Map<String, MiningLocationLabels.glaciteCategory> GLACITE_LOCATIONS = Arrays.stream(MiningLocationLabels.glaciteCategory.values()).collect(Collectors.toMap(MiningLocationLabels.glaciteCategory::toString, Function.identity())); + private static final Map<String, MiningLocationLabel.dwarvenCategory> DWARVEN_LOCATIONS = Arrays.stream(MiningLocationLabel.dwarvenCategory.values()).collect(Collectors.toMap(MiningLocationLabel.dwarvenCategory::toString, Function.identity())); + private static final Map<String, MiningLocationLabel.glaciteCategory> GLACITE_LOCATIONS = Arrays.stream(MiningLocationLabel.glaciteCategory.values()).collect(Collectors.toMap(MiningLocationLabel.glaciteCategory::toString, Function.identity())); - protected static List<MiningLocationLabels> activeWaypoints = new ArrayList<>(); + protected static List<MiningLocationLabel> activeWaypoints = new ArrayList<>(); public static void init() { WorldRenderEvents.AFTER_TRANSLUCENT.register(CommissionLabels::render); } protected static void update(List<String> newCommissions) { - System.out.println(newCommissions); + if (!SkyblockerConfigManager.get().locations.dwarvenMines.commissionWaypoints.enabled) { + return; + } activeWaypoints.clear(); String location = Utils.getIslandArea().substring(2); //find commission locations in glacite if (location.equals("Dwarven Base Camp") || location.equals("Glacite Tunnels")) { for (String commission : newCommissions) { - for (Map.Entry<String, MiningLocationLabels.glaciteCategory> glaciteLocation : GLACITE_LOCATIONS.entrySet()) { + for (Map.Entry<String, MiningLocationLabel.glaciteCategory> glaciteLocation : GLACITE_LOCATIONS.entrySet()) { if (commission.contains(glaciteLocation.getKey())) { - MiningLocationLabels.glaciteCategory category = glaciteLocation.getValue(); + MiningLocationLabel.glaciteCategory category = glaciteLocation.getValue(); for (BlockPos gemstoneLocation : category.getLocations()) { - activeWaypoints.add(new MiningLocationLabels(category, gemstoneLocation)); + activeWaypoints.add(new MiningLocationLabel(category, gemstoneLocation)); } } } } + //add base waypoint if enabled + if (SkyblockerConfigManager.get().locations.dwarvenMines.commissionWaypoints.showBaseCamp) { + activeWaypoints.add(new MiningLocationLabel(MiningLocationLabel.glaciteCategory.CAMPFIRE, MiningLocationLabel.glaciteCategory.CAMPFIRE.getLocations()[0])); + } return; } //find commission locations in dwarven mines for (String commission : newCommissions) { - for (Map.Entry<String, MiningLocationLabels.dwarvenCategory> dwarvenLocation : DWARVEN_LOCATIONS.entrySet()) { + for (Map.Entry<String, MiningLocationLabel.dwarvenCategory> dwarvenLocation : DWARVEN_LOCATIONS.entrySet()) { if (commission.contains(dwarvenLocation.getKey())) { - MiningLocationLabels.dwarvenCategory category = dwarvenLocation.getValue(); + MiningLocationLabel.dwarvenCategory category = dwarvenLocation.getValue(); category.isTitanium = commission.contains("Titanium"); - activeWaypoints.add(new MiningLocationLabels(category, category.getLocation())); + activeWaypoints.add(new MiningLocationLabel(category, category.getLocation())); } } } } private static void render(WorldRenderContext context) { - if (!Utils.isInDwarvenMines()) { + if (!Utils.isInDwarvenMines() || !SkyblockerConfigManager.get().locations.dwarvenMines.commissionWaypoints.enabled) { return; } - for (MiningLocationLabels MiningLocationLabels : activeWaypoints) { - MiningLocationLabels.render(context); + for (MiningLocationLabel MiningLocationLabel : activeWaypoints) { + MiningLocationLabel.render(context); } } } |