Skip to content

Commit

Permalink
Add hide the action bar directly.
Browse files Browse the repository at this point in the history
  • Loading branch information
MrCubee committed Mar 21, 2022
1 parent 9d272e2 commit a5f3910
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main/java/fr/mrcubee/waypoint/GPS.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,11 @@ public void run() {
LOCATIONS.remove(key);
} else if (object instanceof WayPoint) {
targetLocation = (Location) object;
sendLocationDirection(key, targetLocation, "gps.action_bar.waypoint", ((WayPoint) targetLocation).getName());
if (targetLocation.distance(key.getLocation()) < 1)
if (targetLocation.distance(key.getLocation()) < 2) {
LOCATIONS.remove(key);
key.spigot().sendMessage(ChatMessageType.ACTION_BAR, new TextComponent());
} else
sendLocationDirection(key, targetLocation, "gps.action_bar.waypoint", ((WayPoint) targetLocation).getName());
} else if (object instanceof Location) {
targetLocation = (Location) object;
sendLocationDirection(key, targetLocation, "gps.action_bar.location", null);
Expand Down

0 comments on commit a5f3910

Please sign in to comment.