mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-09-28 23:27:40 +02: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.Talkable;
|
||||||
import net.citizensnpcs.api.ai.speech.TalkableEntity;
|
import net.citizensnpcs.api.ai.speech.TalkableEntity;
|
||||||
import net.citizensnpcs.api.event.NPCCollisionEvent;
|
import net.citizensnpcs.api.event.NPCCollisionEvent;
|
||||||
|
import net.citizensnpcs.api.event.NPCPistonPushEvent;
|
||||||
import net.citizensnpcs.api.event.NPCPushEvent;
|
import net.citizensnpcs.api.event.NPCPushEvent;
|
||||||
import net.citizensnpcs.api.npc.NPC;
|
import net.citizensnpcs.api.npc.NPC;
|
||||||
import net.citizensnpcs.api.util.BoundingBox;
|
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) {
|
public static <T> T callPossiblySync(Callable<T> callable, boolean sync) {
|
||||||
if (!sync) {
|
if (!sync) {
|
||||||
try {
|
try {
|
||||||
|
Loading…
Reference in New Issue
Block a user