Refactor map integration system to use abstract methods, start work on BlueMap support

Fix failed RTP still taking money (Closes #45)
This commit is contained in:
WiIIiam278 committed 2021-06-07 01:11:46 +01:00
1 parent 884d61d938
commit 30cf917969
14 files changed
+229 -116

No files matched your search

@@ -25,13 +25,16 @@ public class RandomPoint extends TeleportationPoint {
// Maximum number of attempts to find a random location
private static final int MAX_RANDOM_ATTEMPTS = 8;
private static boolean hasFailed;
public RandomPoint(Player player) {
super(player.getLocation(), HuskHomes.getSettings().getServerID());
hasFailed = false;
Location randomLocation = getRandomLocation(player.getWorld());
if (randomLocation != null) {
setLocation(randomLocation, HuskHomes.getSettings().getServerID());
} else {
hasFailed = true;
MessageManager.sendMessage(player, "error_rtp_randomization_timeout");
}
}
@@ -114,4 +117,8 @@ public class RandomPoint extends TeleportationPoint {
return null;
}
public boolean hasFailed() {
return hasFailed;
}
}