mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-04 06:28:49 +00:00
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:
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;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user