This commit is contained in:
fullwall 2012-10-30 22:26:21 +08:00
parent d84594019d
commit d1e0d99395

View File

@ -15,6 +15,7 @@ import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.api.persistence.PersistenceLoader;
import net.citizensnpcs.api.util.DataKey;
import net.citizensnpcs.editor.Editor;
import net.citizensnpcs.trait.CurrentLocation;
import net.citizensnpcs.trait.waypoint.triggers.TriggerEditPrompt;
import net.citizensnpcs.util.Messages;
import net.citizensnpcs.util.Messaging;
@ -193,9 +194,11 @@ public class LinearWaypointProvider implements WaypointProvider {
@EventHandler(ignoreCancelled = true)
public void onPlayerInteract(PlayerInteractEvent event) {
if (event.getPlayer() == null)
return;
if (!event.getPlayer().equals(player) || event.getAction() == Action.PHYSICAL)
return;
if (event.getPlayer().getWorld() != npc.getBukkitEntity().getWorld())
if (event.getPlayer().getWorld() != npc.getTrait(CurrentLocation.class).getWorld())
return;
if (event.getAction() == Action.LEFT_CLICK_BLOCK || event.getAction() == Action.LEFT_CLICK_AIR) {
if (event.getClickedBlock() == null)