Small fix + remove duplicate code

This commit is contained in:
filoghost 2016-08-29 10:00:06 +02:00
parent 90ac307519
commit b7eefd44c9
2 changed files with 6 additions and 7 deletions

View File

@ -113,9 +113,9 @@ public class MainListener implements Listener {
try {
touchSlime.getTouchablePiece().getTouchHandler().onTouch(event.getPlayer());
} catch (Exception ex) {
} catch (Throwable t) {
Plugin plugin = touchSlime.getParent() instanceof PluginHologram ? ((PluginHologram) touchSlime.getParent()).getOwner() : HolographicDisplays.getInstance();
HolographicDisplays.getInstance().getLogger().log(Level.WARNING, "The plugin " + plugin.getName() + " generated an exception when the player " + event.getPlayer().getName() + " touched a hologram.", ex);
HolographicDisplays.getInstance().getLogger().log(Level.WARNING, "The plugin " + plugin.getName() + " generated an exception when the player " + event.getPlayer().getName() + " touched a hologram.", t);
}
}
}
@ -131,9 +131,9 @@ public class MainListener implements Listener {
if (hologram.getVisibilityManager().isVisibleTo(player)) {
pickupHandler.onPickup(player);
}
} catch (Exception ex) {
} catch (Throwable t) {
Plugin plugin = hologram instanceof PluginHologram ? ((PluginHologram) hologram).getOwner() : HolographicDisplays.getInstance();
HolographicDisplays.getInstance().getLogger().log(Level.WARNING, "The plugin " + plugin.getName() + " generated an exception when the player " + player.getName() + " picked up an item from a hologram.", ex);
HolographicDisplays.getInstance().getLogger().log(Level.WARNING, "The plugin " + plugin.getName() + " generated an exception when the player " + player.getName() + " picked up an item from a hologram.", t);
}
}

View File

@ -324,15 +324,14 @@ public class CraftHologram implements Hologram, com.gmail.filoghost.holograms.ap
Validator.isTrue(!deleted, "hologram already deleted");
Validator.notNull(world, "world");
if (this.world != world) {
updateLocation(world, x, y, z);
if (this.world != world) {
despawnEntities();
refreshAll();
return;
}
updateLocation(world, x, y, z);
double currentY = y;
boolean first = true;