Skip to content

Commit

Permalink
Temporarily log number format exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
fullwall committed Mar 12, 2023
1 parent 3f97618 commit 2c9733e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
Expand Up @@ -241,6 +241,7 @@ public boolean executeSafe(org.bukkit.command.Command command, String[] args, Co
return false;
} catch (WrappedCommandException ex) {
if (ex.getCause() instanceof NumberFormatException) {
ex.printStackTrace();
Messaging.sendErrorTr(sender, CommandMessages.INVALID_NUMBER);
} else {
throw ex.getCause();
Expand Down
15 changes: 3 additions & 12 deletions src/main/java/net/citizensnpcs/api/npc/AbstractNPC.java
Expand Up @@ -520,24 +520,15 @@ private void teleport(final Entity entity, Location location, int delay, Telepor
final Entity passenger = entity.getPassenger();
entity.eject();
if (!location.getWorld().equals(entity.getWorld())) {
Bukkit.getScheduler().scheduleSyncDelayedTask(CitizensAPI.getPlugin(), new Runnable() {
@Override
public void run() {
entity.teleport(location, cause);
}
}, delay++);
Bukkit.getScheduler().scheduleSyncDelayedTask(CitizensAPI.getPlugin(),
() -> entity.teleport(location, cause), delay++);
} else {
entity.teleport(location, cause);
}
if (passenger == null)
return;
teleport(passenger, location, delay++, cause);
Runnable task = new Runnable() {
@Override
public void run() {
entity.setPassenger(passenger);
}
};
Runnable task = () -> entity.setPassenger(passenger);
if (!location.getWorld().equals(entity.getWorld())) {
Bukkit.getScheduler().scheduleSyncDelayedTask(CitizensAPI.getPlugin(), task, delay);
} else {
Expand Down

0 comments on commit 2c9733e

Please sign in to comment.