From 8b7bcbb8805021c555f1c1528fc1711af5ac52aa Mon Sep 17 00:00:00 2001 From: md678685 <1917406+md678685@users.noreply.github.com> Date: Mon, 17 Jun 2019 11:06:45 +0100 Subject: [PATCH] Don't update user activity on physical interactions Fixes #2578. --- .../com/earth2me/essentials/EssentialsPlayerListener.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java index 2a82afa9a..737e2a487 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java @@ -596,6 +596,8 @@ public class EssentialsPlayerListener implements Listener { @EventHandler(priority = EventPriority.NORMAL) public void onPlayerInteract(final PlayerInteractEvent event) { + boolean updateActivity = true; + switch (event.getAction()) { case RIGHT_CLICK_BLOCK: if (!event.isCancelled() && MaterialUtil.isBed(event.getClickedBlock().getType()) && ess.getSettings().getUpdateBedAtDaytime()) { @@ -622,8 +624,14 @@ public class EssentialsPlayerListener implements Listener { } } break; + case PHYSICAL: + updateActivity = false; + break; } + + if (updateActivity) { ess.getUser(event.getPlayer()).updateActivityOnInteract(true); + } } // This method allows the /jump lock feature to work, allows teleporting while flying #EasterEgg