From 5e360995eb0ca81f258a2c3be2d85ece7d180be3 Mon Sep 17 00:00:00 2001 From: Iaccidentally Date: Tue, 16 Apr 2013 15:58:13 -0400 Subject: [PATCH] [FIX] Update user activity when shooting a bow --- .../earth2me/essentials/EssentialsEntityListener.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java b/Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java index 1bdf82445..67cc8f067 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java @@ -10,8 +10,8 @@ import org.bukkit.entity.*; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; -import org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason; import org.bukkit.event.entity.*; +import org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason; import org.bukkit.inventory.ItemStack; @@ -200,4 +200,12 @@ public class EssentialsEntityListener implements Listener } } } + @EventHandler(priority = EventPriority.LOW, ignoreCancelled = true) + public void onEntityShootBow (EntityShootBowEvent event) + { + if (event.getEntity() instanceof Player && ess.getUser(event.getEntity()).isAfk()) + { + ess.getUser(event.getEntity()).updateActivity(true); + } + } }