Add ability to define cooldowns for actions (#437)

This commit is contained in:
William authored and GitHub committed 2023-06-16 17:39:54 +01:00
1 parent fb052340c0
commit fc8d3b0098
52 files changed
+1140 -619

No files matched your search

@@ -108,13 +108,13 @@ public class BukkitUser extends OnlineUser {
// Ensure the world exists
final Optional<org.bukkit.Location> resolvedLocation = BukkitAdapter.adaptLocation(location);
if (resolvedLocation.isEmpty() || resolvedLocation.get().getWorld() == null) {
throw new TeleportationException(TeleportationException.Type.WORLD_NOT_FOUND);
throw new TeleportationException(TeleportationException.Type.WORLD_NOT_FOUND, plugin);
}
// Ensure the coordinates are within the world limits
final org.bukkit.Location bukkitLocation = resolvedLocation.get();
if (!bukkitLocation.getWorld().getWorldBorder().isInside(resolvedLocation.get())) {
throw new TeleportationException(TeleportationException.Type.ILLEGAL_TARGET_COORDINATES);
throw new TeleportationException(TeleportationException.Type.ILLEGAL_TARGET_COORDINATES, plugin);
}
// Run on the appropriate thread scheduler for this platform