mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-09-24 13:22:50 +02:00
Use new method
This commit is contained in:
parent
ef9220b5fd
commit
c22916bb70
@ -452,9 +452,14 @@ public class EventListen implements Listener {
|
||||
}
|
||||
if (npc.hasTrait(CommandTrait.class)) {
|
||||
npc.getTraitNullable(CommandTrait.class).dispatch(player, CommandTrait.Hand.RIGHT);
|
||||
rightClickEvent.setDelayedCancellation(true);
|
||||
}
|
||||
if (npc.hasTrait(ShopTrait.class)) {
|
||||
npc.getTraitNullable(ShopTrait.class).onRightClick(player);
|
||||
rightClickEvent.setDelayedCancellation(true);
|
||||
}
|
||||
if (rightClickEvent.isDelayedCancellation()) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -106,6 +106,7 @@ public class NPCSelector implements Listener, net.citizensnpcs.api.npc.NPCSelect
|
||||
player.removeMetadata("selected", plugin);
|
||||
select(player, npc);
|
||||
Messaging.sendWithNPC(player, Setting.SELECTION_MESSAGE.asString(), npc);
|
||||
event.setDelayedCancellation(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -188,6 +188,7 @@ public class Controllable extends Trait implements Toggleable, CommandConfigurab
|
||||
if (!enabled || !npc.isSpawned() || !event.getNPC().equals(npc))
|
||||
return;
|
||||
controller.rightClickEntity(event);
|
||||
event.setDelayedCancellation(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -28,6 +28,7 @@ public class PausePathfindingTrait extends Trait {
|
||||
if (!rightclick || event.getNPC() != npc)
|
||||
return;
|
||||
pause();
|
||||
event.setDelayedCancellation(true);
|
||||
}
|
||||
|
||||
private void pause() {
|
||||
|
@ -156,6 +156,7 @@ public class Text extends Trait implements Runnable, Listener {
|
||||
String localPattern = itemInHandPattern.equals("default") ? Setting.TALK_ITEM.asString() : itemInHandPattern;
|
||||
if (Util.matchesItemInHand(event.getClicker(), localPattern) && !shouldTalkClose()) {
|
||||
talk(event.getClicker());
|
||||
event.setDelayedCancellation(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user