From 76d70593d0283e86326a23ebd02b793889b8aba8 Mon Sep 17 00:00:00 2001 From: Boosik Date: Fri, 15 Mar 2013 15:31:14 +0100 Subject: [PATCH] PlayerMoveEvent is now more lightweight --- .../Listeners/boosPlayerMoveListener.class | Bin 2390 -> 2479 bytes bin/plugin.yml | 2 +- .../Listeners/boosPlayerMoveListener.java | 13 +++++++++---- src/plugin.yml | 2 +- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/bin/cz/boosik/boosCooldown/Listeners/boosPlayerMoveListener.class b/bin/cz/boosik/boosCooldown/Listeners/boosPlayerMoveListener.class index afe20b26ed36913851ab5899a6377ee4e97e15c5..caeabacbbf7fcda748faea07ad147192915f5d80 100644 GIT binary patch delta 1016 zcmX|<%~MlX7{-6+-kaPcTp~@7Z!jooya_~7{DfM8qGE+sv3|E2APtc~Fa)Nyv~jw0 z$DDc- z^DjV}2kW77I9SduEM3koWJ?M)zP{F0SMLxc6hyIW^HGoTchF_isb8w3xrdnkM>PdH z*z2&59vwD%)d4+Z#DZ~Ln?s5g9Wz>d4hfR_d&3R(ao8rMh_5#^>pzXC*-u*kZS;2x zI2<9Z2+U=cCyJ}t*$~G#VRKxO@UUmhCi5hN`nH)4e!zz|r{0omno;vK!}@n~uzi#< zn~xOrE9HD4HC-$&kIrSv4re&4JFWA9KE@r+3ro>j3&gqTaEU4XuhoPAtsnXlW`=3Kwsw%=_##$AVbZYhFGh0OhIsZgA;Sx`i^vZJ98 zGZY<`xToj*`vL`)9m=d|?SENO(kh#PL{mB=tyBE3uBFj;kLtBivnF$-79(OW zDh79p%qH4JN{8s^7A54#?djXE_`aQ?BSvNKDGPy$sOD zFe!1At~nUkQBYIs_38v)abNT`j|uQ=Ne$V4kZ)KMa#!xqs=Ce%eEi-S;FlRF>C9>x8oY8-nbNw%J&gQHlw$Z3m zb1S~TK41144(FNI)1k`|mkSOr%l^Be?MRA6hb3Oqv2ZH?23Ks}RCN0FQf_5qZLQMC zUGwYJRfo4Yqp(ZG#*%lt*d{zz9jWqgM_e5Ajze%=8SVIv}Qo7`7UtP&e`zbD!h$H0-<3W6QP#CHxC@Dv?E zzLTeARb2d-WV&P=DRPwVpx$?qG9@*e-lu1eP*d!&#mq0HGx4DVc7_e^k<2_|e2;{f z+#Yc;c^S_=;sr4;wJ6MhA|K3g!R->@qtdTidiO9OPsSy|1brf)Umjf_rzJW=G9XSK zBK%7%FkIx4aK_ll@(P!Q@l|Qkh7ozfNn4IO+ImE?qID#X2@w{1!98F>alq?}g@?TD z?(@!1EH6sfQ!G8Cco-?qhSHgRZrvjsdXNZZ_o*GB{^kAFule9VF(a+wI}D4alxR4? zAS0q;ROrW;Vw`jGH%~TDFm*@}z_xB+h6WqL*CUjh;u*4gl#lsDl)7>PTjGTRQ3;H{ YrCeB4*(?WN*`|yfhT>C8a11{C2d1u~j{pDw diff --git a/bin/plugin.yml b/bin/plugin.yml index 0fbdbd8..fb9331e 100644 --- a/bin/plugin.yml +++ b/bin/plugin.yml @@ -1,6 +1,6 @@ name: boosCooldowns main: cz.boosik.boosCooldown.boosCoolDown -version: 3.4.0 +version: 3.4.1 authors: [LordBoos (ingame name boosik)] softdepend: [Vault] description: > diff --git a/src/cz/boosik/boosCooldown/Listeners/boosPlayerMoveListener.java b/src/cz/boosik/boosCooldown/Listeners/boosPlayerMoveListener.java index a10ab31..5ecb645 100644 --- a/src/cz/boosik/boosCooldown/Listeners/boosPlayerMoveListener.java +++ b/src/cz/boosik/boosCooldown/Listeners/boosPlayerMoveListener.java @@ -6,18 +6,22 @@ import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; import org.bukkit.event.player.PlayerMoveEvent; - import util.boosChat; import cz.boosik.boosCooldown.boosConfigManager; import cz.boosik.boosCooldown.boosCoolDownListener; import cz.boosik.boosCooldown.boosWarmUpManager; public class boosPlayerMoveListener implements Listener { + int tempTimer = 0; @EventHandler(priority = EventPriority.NORMAL) private void onPlayerMove(PlayerMoveEvent event) { - if (event.isCancelled()) + if (event.isCancelled()) { return; - + } + if (tempTimer < 20){ + tempTimer = tempTimer + 1; + return; + } else { Player player = event.getPlayer(); if (player != null && !player.hasPermission("booscooldowns.nocancel.move")) { @@ -27,9 +31,10 @@ public class boosPlayerMoveListener implements Listener { boosConfigManager.getWarmUpCancelledByMoveMessage()); boosWarmUpManager.cancelWarmUps(player); } - } + tempTimer = 0; } +} private static boolean hasMoved(Player player) { String curworld = player.getWorld().getName(); diff --git a/src/plugin.yml b/src/plugin.yml index 0fbdbd8..fb9331e 100644 --- a/src/plugin.yml +++ b/src/plugin.yml @@ -1,6 +1,6 @@ name: boosCooldowns main: cz.boosik.boosCooldown.boosCoolDown -version: 3.4.0 +version: 3.4.1 authors: [LordBoos (ingame name boosik)] softdepend: [Vault] description: >