diff options
author | olim <bobq4582@gmail.com> | 2024-01-30 19:30:10 +0000 |
---|---|---|
committer | olim <bobq4582@gmail.com> | 2024-01-30 19:30:10 +0000 |
commit | bc5cf9a37e4241096bd5ec1b2491ad71281593ff (patch) | |
tree | baa6bcf4c7b48ee9e3db4559e2f43e825708e60d /src/main/java/de/hysky/skyblocker/skyblock/dwarven/CrystalsLocationsManager.java | |
parent | 51b7043abab1d91beb4f0dabec6b9ffe8ca7b1bf (diff) | |
download | Skyblocker-bc5cf9a37e4241096bd5ec1b2491ad71281593ff.tar.gz Skyblocker-bc5cf9a37e4241096bd5ec1b2491ad71281593ff.tar.bz2 Skyblocker-bc5cf9a37e4241096bd5ec1b2491ad71281593ff.zip |
fixed cwords from chat
fixed not being able to get coordinates from chat by using the correct ClientReceiveMessageEvent of GAME instead of CHAT
Diffstat (limited to 'src/main/java/de/hysky/skyblocker/skyblock/dwarven/CrystalsLocationsManager.java')
-rw-r--r-- | src/main/java/de/hysky/skyblocker/skyblock/dwarven/CrystalsLocationsManager.java | 14 |
1 files changed, 7 insertions, 7 deletions
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 |