mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-26 12:46:04 +01:00
Pushed missing file
This commit is contained in:
parent
309b1d7b65
commit
a06b2ed2c6
@ -42,6 +42,7 @@ import net.citizensnpcs.api.ai.speech.SpeechContext;
|
||||
import net.citizensnpcs.api.ai.speech.Talkable;
|
||||
import net.citizensnpcs.api.ai.speech.TalkableEntity;
|
||||
import net.citizensnpcs.api.event.NPCCollisionEvent;
|
||||
import net.citizensnpcs.api.event.NPCPistonPushEvent;
|
||||
import net.citizensnpcs.api.event.NPCPushEvent;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.api.util.BoundingBox;
|
||||
@ -59,6 +60,17 @@ public class Util {
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean callPistonPushEvent(NPC npc) {
|
||||
if (npc == null)
|
||||
return false;
|
||||
NPCPistonPushEvent event = new NPCPistonPushEvent(npc);
|
||||
if (npc.isProtected()) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
return event.isCancelled();
|
||||
}
|
||||
|
||||
public static <T> T callPossiblySync(Callable<T> callable, boolean sync) {
|
||||
if (!sync) {
|
||||
try {
|
||||
|
Loading…
Reference in New Issue
Block a user