diff --git a/main/src/main/java/net/citizensnpcs/EventListen.java b/main/src/main/java/net/citizensnpcs/EventListen.java index 486f8b00b..dfdd1eb0c 100644 --- a/main/src/main/java/net/citizensnpcs/EventListen.java +++ b/main/src/main/java/net/citizensnpcs/EventListen.java @@ -238,7 +238,7 @@ public class EventListen implements Listener { NPC npc = CitizensAPI.getNPCRegistry().getNPC(event.getEntity()); if (npc == null) return; - event.setCancelled(npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true)); + event.setCancelled(npc.isProtected()); if (event instanceof EntityCombustByEntityEvent) { Bukkit.getPluginManager().callEvent(new NPCCombustByEntityEvent((EntityCombustByEntityEvent) event, npc)); } else if (event instanceof EntityCombustByBlockEvent) { @@ -256,13 +256,13 @@ public class EventListen implements Listener { npc = CitizensAPI.getNPCRegistry().getNPC(((EntityDamageByEntityEvent) event).getDamager()); if (npc == null) return; - event.setCancelled(!npc.data().get(NPC.DAMAGE_OTHERS_METADATA, true)); + event.setCancelled(!npc.isProtected()); NPCDamageEntityEvent damageEvent = new NPCDamageEntityEvent(npc, (EntityDamageByEntityEvent) event); Bukkit.getPluginManager().callEvent(damageEvent); } return; } - event.setCancelled(npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true)); + event.setCancelled(npc.isProtected()); if (event instanceof EntityDamageByEntityEvent) { NPCDamageByEntityEvent damageEvent = new NPCDamageByEntityEvent(npc, (EntityDamageByEntityEvent) event); Bukkit.getPluginManager().callEvent(damageEvent); @@ -341,8 +341,7 @@ public class EventListen implements Listener { NPC npc = CitizensAPI.getNPCRegistry().getNPC(event.getTarget()); if (npc == null) return; - event.setCancelled( - !npc.data().get(NPC.TARGETABLE_METADATA, !npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true))); + event.setCancelled(!npc.data().get(NPC.TARGETABLE_METADATA, !npc.isProtected())); Bukkit.getPluginManager().callEvent(new EntityTargetNPCEvent(event, npc)); } diff --git a/main/src/main/java/net/citizensnpcs/commands/WaypointCommands.java b/main/src/main/java/net/citizensnpcs/commands/WaypointCommands.java index c1538d27d..a0dc89576 100644 --- a/main/src/main/java/net/citizensnpcs/commands/WaypointCommands.java +++ b/main/src/main/java/net/citizensnpcs/commands/WaypointCommands.java @@ -110,21 +110,17 @@ public class WaypointCommands { @Command( aliases = { "waypoints", "waypoint", "wp" }, - usage = "provider [provider name] (-d)", + usage = "provider [provider name]", desc = "Sets the current waypoint provider", modifiers = { "provider" }, min = 1, max = 2, - flags = "d", permission = "citizens.waypoints.provider") public void provider(CommandContext args, CommandSender sender, NPC npc) throws CommandException { Waypoints waypoints = npc.getOrAddTrait(Waypoints.class); if (args.argsLength() == 1) { - if (args.hasFlag('d')) { - waypoints.describeProviders(sender); - } else { - Messaging.sendTr(sender, Messages.CURRENT_WAYPOINT_PROVIDER, waypoints.getCurrentProviderName()); - } + Messaging.sendTr(sender, Messages.CURRENT_WAYPOINT_PROVIDER, waypoints.getCurrentProviderName()); + waypoints.describeProviders(sender); return; } if (sender instanceof Player && Editor.hasEditor(((Player) sender))) { diff --git a/main/src/main/java/net/citizensnpcs/npc/skin/SkinUpdateTracker.java b/main/src/main/java/net/citizensnpcs/npc/skin/SkinUpdateTracker.java index 42fa59b76..de704fbdd 100644 --- a/main/src/main/java/net/citizensnpcs/npc/skin/SkinUpdateTracker.java +++ b/main/src/main/java/net/citizensnpcs/npc/skin/SkinUpdateTracker.java @@ -28,6 +28,7 @@ import net.citizensnpcs.Settings.Setting; import net.citizensnpcs.api.CitizensAPI; import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPCRegistry; +import net.citizensnpcs.api.util.Messaging; import net.citizensnpcs.util.Util; /** @@ -328,6 +329,10 @@ public class SkinUpdateTracker { public void run() { List visible = getNearbyNPCs(player, reset, false); for (SkinnableEntity skinnable : visible) { + if (Messaging.isDebugging()) { + Messaging.debug("Sending skin from", skinnable.getBukkitEntity(), "to", player, "(" + delay, + reset + ")"); + } skinnable.getSkinTracker().updateViewer(player); } }