From a222e4a252012ef3b5d6b711f723749ccc14a240 Mon Sep 17 00:00:00 2001 From: Parker Hawke Date: Sun, 16 Sep 2018 12:57:03 -0400 Subject: Implement BatToggleSleepEvent --- src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src') diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java index c1acd202..deb166d7 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -36,6 +36,7 @@ import org.bukkit.craftbukkit.util.CraftDamageSource; import org.bukkit.craftbukkit.util.CraftMagicNumbers; import org.bukkit.entity.AreaEffectCloud; import org.bukkit.entity.Arrow; +import org.bukkit.entity.Bat; import org.bukkit.entity.Creeper; import org.bukkit.entity.EntityType; import org.bukkit.entity.ExperienceOrb; @@ -1122,4 +1123,10 @@ public class CraftEventFactory { return !event.isCancelled(); } + + public static boolean handleBatToggleSleepEvent(Entity bat, boolean awake) { + BatToggleSleepEvent event = new BatToggleSleepEvent((Bat) bat.getBukkitEntity(), awake); + Bukkit.getPluginManager().callEvent(event); + return !event.isCancelled(); + } } -- cgit v1.2.3