mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-04 18:00:00 +01:00
Test
This commit is contained in:
parent
d1e0d99395
commit
08ef13f6c4
@ -15,7 +15,6 @@ import net.citizensnpcs.api.npc.NPC;
|
|||||||
import net.citizensnpcs.api.persistence.PersistenceLoader;
|
import net.citizensnpcs.api.persistence.PersistenceLoader;
|
||||||
import net.citizensnpcs.api.util.DataKey;
|
import net.citizensnpcs.api.util.DataKey;
|
||||||
import net.citizensnpcs.editor.Editor;
|
import net.citizensnpcs.editor.Editor;
|
||||||
import net.citizensnpcs.trait.CurrentLocation;
|
|
||||||
import net.citizensnpcs.trait.waypoint.triggers.TriggerEditPrompt;
|
import net.citizensnpcs.trait.waypoint.triggers.TriggerEditPrompt;
|
||||||
import net.citizensnpcs.util.Messages;
|
import net.citizensnpcs.util.Messages;
|
||||||
import net.citizensnpcs.util.Messaging;
|
import net.citizensnpcs.util.Messaging;
|
||||||
@ -194,11 +193,10 @@ public class LinearWaypointProvider implements WaypointProvider {
|
|||||||
|
|
||||||
@EventHandler(ignoreCancelled = true)
|
@EventHandler(ignoreCancelled = true)
|
||||||
public void onPlayerInteract(PlayerInteractEvent event) {
|
public void onPlayerInteract(PlayerInteractEvent event) {
|
||||||
if (event.getPlayer() == null)
|
if (event.getPlayer() == null || !event.getPlayer().equals(player)
|
||||||
|
|| event.getAction() == Action.PHYSICAL)
|
||||||
return;
|
return;
|
||||||
if (!event.getPlayer().equals(player) || event.getAction() == Action.PHYSICAL)
|
if (!npc.isSpawned() || event.getPlayer().getWorld() != npc.getBukkitEntity().getWorld())
|
||||||
return;
|
|
||||||
if (event.getPlayer().getWorld() != npc.getTrait(CurrentLocation.class).getWorld())
|
|
||||||
return;
|
return;
|
||||||
if (event.getAction() == Action.LEFT_CLICK_BLOCK || event.getAction() == Action.LEFT_CLICK_AIR) {
|
if (event.getAction() == Action.LEFT_CLICK_BLOCK || event.getAction() == Action.LEFT_CLICK_AIR) {
|
||||||
if (event.getClickedBlock() == null)
|
if (event.getClickedBlock() == null)
|
||||||
|
Loading…
Reference in New Issue
Block a user