From 73b8c0ce03e8328a44e15e244fcf817051aec53f Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Fri, 29 Jan 2016 22:51:46 +0100 Subject: [PATCH] Allowed fly and teleport in 200 day minigame --- TheButtonAutoFlair.jar | Bin 320829 -> 321394 bytes .../CreativeGlobalMechanic.java | 23 +++++++++++++++--- .../CreativeGlobalMechanic.class | Bin 2698 -> 3861 bytes 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/TheButtonAutoFlair.jar b/TheButtonAutoFlair.jar index 5e5c5677a0a8e223d702d0cd02fa2620f3766968..640970c2198672b230c579338c941d3a690a6d9d 100644 GIT binary patch delta 2123 zcmYLGc{tQ-8|F8!eVSn`*^V-4K}0y!$gzYFW6L^rl5r4OM&V5L$@baBn{vXO_z)>Z zmMkG5Vl2lb#v0~?NK&*o<8yuI`{TLZ>%O1+y`Sg0pQe|hYki_LOi&&8~{ zj;=v-r}HDjHSiukw;9!*<`aaRZXr_EB!q#Bv8-)-0W8UYp^GjF@y*~W6Q{XDy5zrC40SBnnje*muV-J&Ea8qtBhgx18) zYp)24n00LXU0sA4bX=xq#4yM)+Nm!0-l?^$ryW`7n6di(3~3Mc=$c(DskPjmt)_Ci zpZ@Py3o^+%@Unw~ON3yv9c43?Ff>=uraGK}X4dj8Anr49E4eutS`Q`~s>?HT$kl$K z{gm!4tfhBMa8H6;w6xt{p;6xZ^_?x%mq;W=PqwqQ?kj5ctytQszfs?#!z@w9>N;1= zVjY--A4)!e)?V{;7qfF$V+*B{D~ng0!rKD`StpC9FT{D1&JSi7V~g_fLi}hxMb%Cf z=~L8@fpxTJRB>%UEQLOEa!YGneQDCfxKlt97}!Og$(b9Msp<7f^wq=bFg27v@rC7O z;#3sWss1XW0fQ?Vgg!I>D2q$RjJE)7z~ zRPU>$+?Do~jHnPY={!0?vk9A*Y8VP<9ox)3d|=4_sd}_v|0SDhuS7zrzd3Wk+i-BW zQCp2VXPckhQSPKgzO!fa$?U-Gkbsxxn0IormEvq<7b03|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QpgDEFwGdOBZ03OfjP&_=!j@NYp#C5;w5U@WU}z1V8!|F>a` z07N6FiBPH!Xh6AMupMzxofq2h{SZ)r1AhSkvw8suA*oAn4q1u-W4eJN9GS;QH0SXi z#N1I5F*l6mobLls6pwCo3Z2!|>m3@#QG`~nc+<$mlh+bH;` zAJ`!LdWZ^v8EU{pVG;{fh2CA*l>srDx1uoe5vl@vgD11P)+T z_D|1y6vSf|@&>>z^t}#%+w=h$ZV>}Lv`%+HsljA1SdYf)1Nd|uSP6~0B^hKSb<>4G zunW0s1DyuJ4#dF@<_&_aNa{}5Gl;#klqXz1gr#-_0QgG?(1bQYU@0sd!lFA5Eg)l< z*!y2YGQ)s`mV_>FUD(l!P2@j}z1X)%m^=(T(Za$XDcB0Opiw116t>gVl8H`?U;(n% zBs{m7jfd(lv33`xeLe3*RsQrA!}OO}fd$X$73NWDetOGb=_{;7$J;-N0-SyYj8Tnt T34sec^%(_<_%9s*hr|5~S}M&I diff --git a/TheButtonAutoFlair/src/tk/sznp/thebuttonautoflair/CreativeGlobalMechanic.java b/TheButtonAutoFlair/src/tk/sznp/thebuttonautoflair/CreativeGlobalMechanic.java index ba7e90b..50335c0 100644 --- a/TheButtonAutoFlair/src/tk/sznp/thebuttonautoflair/CreativeGlobalMechanic.java +++ b/TheButtonAutoFlair/src/tk/sznp/thebuttonautoflair/CreativeGlobalMechanic.java @@ -3,9 +3,10 @@ package tk.sznp.thebuttonautoflair; import java.util.EnumSet; import java.util.List; -import org.bukkit.event.HandlerList; +import org.bukkit.event.EventHandler; import au.com.mineauz.minigames.MinigamePlayer; +import au.com.mineauz.minigames.events.StartMinigameEvent; import au.com.mineauz.minigames.gametypes.MinigameType; import au.com.mineauz.minigames.mechanics.GameMechanicBase; import au.com.mineauz.minigames.minigame.Minigame; @@ -36,22 +37,25 @@ public class CreativeGlobalMechanic extends GameMechanicBase { @Override public void joinMinigame(Minigame mg, MinigamePlayer mp) { - + mp.getPlayer().setAllowFlight(true); + mp.getPlayer().setFlying(true); + mp.setAllowTeleport(true); } @Override public void quitMinigame(Minigame mg, MinigamePlayer mp, boolean forced) { mg.getBlockRecorder().clearRestoreData(); + } @Override public void startMinigame(Minigame mg, MinigamePlayer mp) { - + mp.setAllowTeleport(true); } @Override public void stopMinigame(Minigame arg0, MinigamePlayer arg1) { - + } @Override @@ -59,4 +63,15 @@ public class CreativeGlobalMechanic extends GameMechanicBase { return EnumSet.of(MinigameType.MULTIPLAYER); } + @EventHandler + private void minigameStart(StartMinigameEvent event) { + if (event.getMinigame().getMechanicName().equals(getMechanic())) { + final List players = event.getPlayers(); + //final Minigame minigame = event.getMinigame(); + for (MinigamePlayer player : players) { + player.setAllowTeleport(true); + } + } + } + } diff --git a/TheButtonAutoFlair/target/classes/tk/sznp/thebuttonautoflair/CreativeGlobalMechanic.class b/TheButtonAutoFlair/target/classes/tk/sznp/thebuttonautoflair/CreativeGlobalMechanic.class index ded17eb46ddb64ab3b469018040a6a0d38f57343..bcf11c5a52578c80c7dca806eff96181962fecab 100644 GIT binary patch delta 1534 zcmZ`(T~ixX7=BK&*^`f@2(%GsC3Z?n5<=G$+S-PSR6tq@)E2R#RhO`aCCdhq4HUmp zzpCTy8J*EMONU$#Qkm zaV>XOZ+dev3}b{N!_a$JjE1w&8IDvTIablw zFmJg=h2&loUF^7NZd3kM-LvKWfN5#VrIr}_Zq}$e8|IQ#wN`9%(s9bJ;aX*<%8)ov zL4W~#sRjBeBO0XGJbE{_9B>Px$Za-vU zW!)@Ls>@QWqoIsVhG=_Ms;rJ~nidaGb1hq+v#Ku5NChqjksUec(NM!SL)dc7is6=N z*5U`y*L*uM+{K$5yA0j?3@xvQx9~QNlVjd>X&{caD7>V6#ggD%4RzdO;A=*8o?;n- z$<#7K$g4EN7!|Pp%AsY?5pvUe5|oJAJTY|8Bos<{V{_4x zr*IT$^wE=vk>&9w12lBd7jfYNx~RqSbP+v-W_S{pXys&Eq+Rlaha0%u+rZQN7epx( z&?zh{%8^IwEt;@TLm*6JhOT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