aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/thatgravyboat
diff options
context:
space:
mode:
authorThatGravyBoat <ThatGravyBoat@users.noreply.github.com>2021-07-16 05:24:57 +0000
committerGitHub Action <actions@github.com>2021-07-16 05:24:57 +0000
commit6bebc34cac85722ba7462c37a09b378403344f51 (patch)
tree4378eb410cec9853bafb439badb1ea5edba2b5ca /src/main/java/com/thatgravyboat
parent6fe4425be08747e258e7a53a9e530aab466bd0c4 (diff)
downloadSkyblockHud-Death-Defied-6bebc34cac85722ba7462c37a09b378403344f51.tar.gz
SkyblockHud-Death-Defied-6bebc34cac85722ba7462c37a09b378403344f51.tar.bz2
SkyblockHud-Death-Defied-6bebc34cac85722ba7462c37a09b378403344f51.zip
Prettified Code!
Diffstat (limited to 'src/main/java/com/thatgravyboat')
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/config/SBHConfig.java1
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/handlers/CrystalWaypoints.java20
2 files changed, 4 insertions, 17 deletions
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/config/SBHConfig.java b/src/main/java/com/thatgravyboat/skyblockhud/config/SBHConfig.java
index c04bccc..e5f5443 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/config/SBHConfig.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/config/SBHConfig.java
@@ -339,7 +339,6 @@ public class SBHConfig extends Config {
@ConfigOption(name = "Chat Waypoint Mode", desc = "Change the mode of the chat waypoint In Chat Bar will allow you to edit it before adding it to your waypoints.")
@ConfigEditorDropdown(values = { "Instant Add", "In chat bar" })
public int chatWaypointMode = 1;
-
}
public static class Trackers {
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/handlers/CrystalWaypoints.java b/src/main/java/com/thatgravyboat/skyblockhud/handlers/CrystalWaypoints.java
index 690f7b3..30c2094 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/handlers/CrystalWaypoints.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/handlers/CrystalWaypoints.java
@@ -70,26 +70,20 @@ public class CrystalWaypoints {
}
@SubscribeEvent
- public void onChatMessage(ClientChatReceivedEvent event){
+ public void onChatMessage(ClientChatReceivedEvent event) {
if (event.type != 2 && LocationHandler.getCurrentLocation().getCategory().equals(LocationCategory.CRYSTALHOLLOWS)) {
Matcher matcher = LOCATION_MESSAGE_REGEX.matcher(event.message.getUnformattedText());
if (!matcher.find()) return;
ChatStyle style = new ChatStyle();
style.setParentStyle(event.message.getChatStyle());
ClickEvent.Action action = SkyblockHud.config.mining.chatWaypointMode == 0 ? ClickEvent.Action.RUN_COMMAND : ClickEvent.Action.SUGGEST_COMMAND;
- style.setChatClickEvent(new ClickEvent(
- action,
- "/sbhpoints addat " + matcher.group(2) + " " + matcher.group(3) + " " + matcher.group(4) + " " + matcher.group(1)
- ));
- style.setChatHoverEvent(new HoverEvent(
- HoverEvent.Action.SHOW_TEXT,
- new ChatComponentText("Click to add waypoint!").setChatStyle(new ChatStyle().setBold(true))
- ));
+ style.setChatClickEvent(new ClickEvent(action, "/sbhpoints addat " + matcher.group(2) + " " + matcher.group(3) + " " + matcher.group(4) + " " + matcher.group(1)));
+ style.setChatHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ChatComponentText("Click to add waypoint!").setChatStyle(new ChatStyle().setBold(true))));
event.message.setChatStyle(style);
}
}
- private static String copyWayPoint(String name){
+ private static String copyWayPoint(String name) {
BlockPos pos = waypoints.get(name);
if (pos == null) {
return null;
@@ -120,7 +114,6 @@ public class CrystalWaypoints {
}
}
break;
-
case "remove":
if (LocationHandler.getCurrentLocation().getCategory().equals(LocationCategory.CRYSTALHOLLOWS)) {
if (CrystalWaypoints.waypoints.containsKey(name)) {
@@ -130,7 +123,6 @@ public class CrystalWaypoints {
}
}
break;
-
case "move":
if (LocationHandler.getCurrentLocation().getCategory().equals(LocationCategory.CRYSTALHOLLOWS)) {
if (CrystalWaypoints.waypoints.containsKey(name)) {
@@ -140,11 +132,9 @@ public class CrystalWaypoints {
}
}
break;
-
case "clear":
CrystalWaypoints.waypoints.clear();
break;
-
case "addat":
if (LocationHandler.getCurrentLocation().getCategory().equals(LocationCategory.CRYSTALHOLLOWS)) {
name = String.join(" ", Arrays.copyOfRange(args, 4, args.length));
@@ -161,7 +151,6 @@ public class CrystalWaypoints {
}
}
break;
-
case "copy":
String copyText = copyWayPoint(name);
if (copyText == null) {
@@ -171,7 +160,6 @@ public class CrystalWaypoints {
StringSelection clipboard = new StringSelection(copyText);
Toolkit.getDefaultToolkit().getSystemClipboard().setContents(clipboard, clipboard);
break;
-
case "send":
String sendText = copyWayPoint(name);
if (sendText == null) {