diff options
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/de/hysky/skyblocker/config/categories/DwarvenMinesCategory.java | 15 | ||||
-rw-r--r-- | src/main/java/de/hysky/skyblocker/skyblock/dwarven/CrystalsLocationsManager.java | 14 |
2 files changed, 11 insertions, 18 deletions
diff --git a/src/main/java/de/hysky/skyblocker/config/categories/DwarvenMinesCategory.java b/src/main/java/de/hysky/skyblocker/config/categories/DwarvenMinesCategory.java index 7581af4f..c575616a 100644 --- a/src/main/java/de/hysky/skyblocker/config/categories/DwarvenMinesCategory.java +++ b/src/main/java/de/hysky/skyblocker/config/categories/DwarvenMinesCategory.java @@ -46,10 +46,10 @@ public class DwarvenMinesCategory { .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud")) .collapsed(false) .option(Option.<Boolean>createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.enabled")) - .binding(defaults.locations.dwarvenMines.dwarvenHud.enabled, - () -> config.locations.dwarvenMines.dwarvenHud.enabled, - newValue -> config.locations.dwarvenMines.dwarvenHud.enabled = newValue) + .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.enabled"))//todo seperate coms and powder + .binding(defaults.locations.dwarvenMines.dwarvenHud.enabledCommissions, + () -> config.locations.dwarvenMines.dwarvenHud.enabledCommissions, + newValue -> config.locations.dwarvenMines.dwarvenHud.enabledCommissions = newValue) .controller(ConfigUtils::createBooleanController) .build()) .option(Option.<SkyblockerConfig.DwarvenHudStyle>createBuilder() @@ -92,13 +92,6 @@ public class DwarvenMinesCategory { .action((screen, opt) -> MinecraftClient.getInstance().setScreen(new CrystalsHudConfigScreen(screen))) .build()) .option(Option.<Boolean>createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.enableBackground")) - .binding(defaults.locations.dwarvenMines.crystalsHud.enableBackground, - () -> config.locations.dwarvenMines.crystalsHud.enableBackground, - newValue -> config.locations.dwarvenMines.crystalsHud.enableBackground = newValue) - .controller(ConfigUtils::createBooleanController) - .build()) - .option(Option.<Boolean>createBuilder() .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dwarvenMines.crystalsHud.showLocations")) .binding(defaults.locations.dwarvenMines.crystalsHud.showLocations, () -> config.locations.dwarvenMines.crystalsHud.showLocations, diff --git a/src/main/java/de/hysky/skyblocker/skyblock/dwarven/CrystalsLocationsManager.java b/src/main/java/de/hysky/skyblocker/skyblock/dwarven/CrystalsLocationsManager.java index 743d4ef5..4ca38a04 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/dwarven/CrystalsLocationsManager.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/dwarven/CrystalsLocationsManager.java @@ -59,21 +59,21 @@ public class CrystalsLocationsManager { public static void init() { WorldRenderEvents.AFTER_TRANSLUCENT.register(CrystalsLocationsManager::render); - ClientReceiveMessageEvents.CHAT.register(CrystalsLocationsManager::extractLocationFromMessage); + ClientReceiveMessageEvents.GAME.register(CrystalsLocationsManager::extractLocationFromMessage); ClientCommandRegistrationCallback.EVENT.register(CrystalsLocationsManager::registerWaypointLocationCommands); } - private static void extractLocationFromMessage(Text message, SignedMessage signedMessage, GameProfile sender, MessageType.Parameters params, Instant receptionTimestamp){ + private static void extractLocationFromMessage(Text message, Boolean overlay){ if (!SkyblockerConfigManager.get().locations.dwarvenMines.crystalsWaypoints.findInChat || !Utils.isInCrystals()) { return; } //get the message text - String value = signedMessage.getContent().getString(); + String value = message.getString(); Matcher matcher = TEXT_CWORDS_PATTERN.matcher(value); - //if there are cwords in the message try to get them and what they are talking about + //if there are coordinates in the message try to get them and what they are talking about if (matcher.find()){ String location = matcher.group(); - Integer[] cowordinates = Arrays.stream(location.split(" ",3)).map(Integer::parseInt).toArray(Integer[]::new); - BlockPos blockPos = new BlockPos(cowordinates[0],cowordinates[1],cowordinates[2]); + Integer[] coordinates = Arrays.stream(location.split(" ",3)).map(Integer::parseInt).toArray(Integer[]::new); + BlockPos blockPos = new BlockPos(coordinates[0],coordinates[1],coordinates[2]); //if position is not in the hollows do not add it if (!checkInCrystals(blockPos)){ return; @@ -164,7 +164,7 @@ public class CrystalsLocationsManager { public static void update() { if (client.player == null || client.getNetworkHandler() == null || !SkyblockerConfigManager.get().locations.dwarvenMines.crystalsWaypoints.enabled) { - SkyblockerConfigManager.get().locations.dwarvenMines.crystalsWaypoints.ActiveWaypoints= new HashMap<>(); + SkyblockerConfigManager.get().locations.dwarvenMines.crystalsWaypoints.ActiveWaypoints= new HashMap<>(); //todo dose not seem to be working return; } //get if the player is in the crystals |