From 2d9d34f8a5d7551b05e8440d46950faa4e7f4abe Mon Sep 17 00:00:00 2001 From: Bryson Steck Date: Sun, 6 Jun 2021 18:34:30 -0600 Subject: [PATCH] trying syncdelaytask --- .../Resurrection/PlayerListener.class | Bin 3278 -> 3236 bytes .../Resurrection/Resurrection.class | Bin 3062 -> 3210 bytes .../Resurrection/PlayerListener.java | 27 +++++++++++------- .../Resurrection/Resurrection.java | 2 +- 4 files changed, 17 insertions(+), 12 deletions(-) diff --git a/out/production/Resurrection/net/brysonsteck/Resurrection/PlayerListener.class b/out/production/Resurrection/net/brysonsteck/Resurrection/PlayerListener.class index 4e4edacbf6c33335f15a9ab1c62030755aca9afb..b1e7cfa8d2057ef16f1af1e3a3492bffbc98d5aa 100644 GIT binary patch delta 1228 zcmZ{kU2hXt5Qd+#&U%y08k#_W&<0_N7RPa7!9@xfDN>uNN@52{QYerVHqK%~%qI9F zkQVBGe^5TNEws?yR8{Yx62z_4AJB_l@e}wHy`W;&>!glU_G0FoIWzCP@0_FkyYrXM z)L;Mp{wL7SPbL~6gC+}|up&BN$R(%Cb91w$_s~{Eaq@+{~$gXs+bHj zVvx4TFsf*4sCuJTtZ2zOrE#aQ=oAzkvF>z3N)S%9a+o6qV;18~tOr>ww0w~4S!br4 z_i^oG2X z8txu4ndP9tIq#s}7tULp$MqKUM0mmC0tN49S(YryEP7A$n7Z^^UwA;%5@~Nh-{DO* zN4%%a*EcC5<0U&gm$4Tn?CHE?@Pk)s*k3U8|kcGzkV*O)i;{&l)kiccG$WHMg70L38|B<{F@h2Z*v_~GXvF8yTnH9V) z^GL;qiDQcGpqVX1*ve+M3775k@iK#SF~SbU*vScr`mH7dxOyuA<|96qmJvqzgiodI zX5QvAJ|`p<2lzr(O@h|TmwY9v2BpW>vI;X&;U%u}4f3i5^qQ=ixh^eyWjDktZgQ)x zV^N|Zi6w;pflT5d16AJASYfEjAw~N;D;)cSspIj)V@{b>rge_}H>-A`0Iy2>*VsUe z9`=fu3Zkn9x~3)}YHmwoo!xac>j^F6)d^h{?}J8#(Ai9)ioCH=aq|ix_baW5-YP{c zU=ga_*cO5He+WE;|iWJ$MN zM2X@Z#oKztyH@y0aR!af_yhQWzrk;O<+CIDyfGjY2HecP=j{8Q^PJ~>&dJi+YikFu z-u&e^0NZgSrt;?{y6^#1$lTjAP`k z=+xngWo8BZ3q{Ma6+A7_{U4T5a;!>a(RQrt=!uMFJNa@+!vvB#QnKtSyOJ+CNyp3- zQWY~}DVSt_xsnT~7Yl`I-U-`fnG>F~9-b8OR2_^Z)nwj+4hM^FXCM?fuHytwx(3}-I-bW1?x{e( zuPQL)-cUBU!~Rx|%S%5l1$KLOw6kgV^i`lI_TbJ(+&`MOw6@gS9XIWinJ!vxP(4TB zCHIoLvkSdA&AAkKkyGcRk39Z1V_)LC2dEI~3HsKVh~8(}StTu656D zRR$kkvE6p4hJpvntlmoaPW}zOkV1{1nd?SgVG~atBhCN- diff --git a/out/production/Resurrection/net/brysonsteck/Resurrection/Resurrection.class b/out/production/Resurrection/net/brysonsteck/Resurrection/Resurrection.class index 4bbc08a46211e6afce92deb0e4f01af79bb326dc..88e19403577e6191ce1bf657160901fece326555 100644 GIT binary patch delta 1091 zcmYk4&vR2%6vsa|?Km z6-Dr8ytwF!88_~nLB}BNjE*y`+&KIJxN@U^fD0Guc}Yi@_vYMl&OP@t_k7R&tL0MM z`{kdNAAuphtay7uny?~aZ-&}zIb>2E8qW~LC?d1j#i`uV>|9pTW zNRTpYrQiOpdb$!kVAxK-qCq;C&K65^h5WIjX^%ltngiHyw>3@SM0tW^nrXw6JY~n+h32Of!OToyY0*cVFg(k1_J(`NeO|G>HiT5L zrTL`a(kV`BvW6F!Rdm=t+zxv-IMOsHN*1%FrD8FAYEko&{W&-qn#T!~|1J>vNj0AL zc%Kh67yR3QXn)l=)Fpd4yi95zo}CDN>S1`A=YtG$5-_ z3JPicZ9utBSTBUw9faWj1bHrXf||sUo55E?*pRH!lKz%^Vx3jGR!JPcM&HDiDqD_- z**4<#RT)TC8CoVLRjC!}1gZR*UI}ZPE9{Zf3A%jBKG~Bs?yhj4Rw(>~*LhU2%9OB= zCa?3jLo#-}$}_8+lvJk5OfvRjEuNP+C$W!uSx|m|4h!~AZ@lcwGFZR(T2m30S!7At zigS@OoD~t2OYLfOmLT)(sNBC&d?Q_M@8pgwJHhlkDew!DZtA0rpkIg#Z8m delta 996 zcmZXS%TrWW5XOIJ?wz@F?;J)ln8>J%PDCC91R_2V5J6EeA{dOQiAe-93O;6Z0AGoK z??}wTIxBanY%CWpOsd8bs*)_SvaHIVkXZf?EH!;+R2JU4)qVQwufKD;&zXxauJE3{ zn*RgX%+L3{&Nhz#VU0^j;bt@4;}gRpr_(+f(P$qHXEVDpMKH=Thf>W4#1ysWMX1&^ zsIJIzK6Lmw4tfs;tp;^OP^HQ~{k4+-bQj)~-NU~m2MYS0XRIN)= zt4UFet&U-sFuK}B$QBs(?fOMIa@$dK6??6nUoHkf3f!W;{guIwrj4*8vZ z#ZiZ^HQ(^9lD@}+Yt3S?wRBj9n@dkj<#OrKNrzF>8EOlSV1+sU`_<5&D*A)R6{a0# z{3d2ifB0{8&6K(A>W10x4yjw_fm^BWnCEWF{z;KA|F{WL?&+DRT$KOW$Vmx_Jt0w} zcqKlVdV+c^ivVL{{WL@v7psc|PI5{jIo`YCW{KVwJ4?m>lR$3XCblFnBb&ZekjEl* zvb`F>5*&V&?Y&fW zH4+w*^RyHoU!+Y^;^X!_+XU=kmFRaoWrt#cUeW$6^_0C9so3Xv4lHm;pd)#{OvR2B z;t`3zli1fviaP}0WNV_{BnuE Xm)zBYyxxOF7f{X-(IWZ diff --git a/src/net/brysonsteck/Resurrection/PlayerListener.java b/src/net/brysonsteck/Resurrection/PlayerListener.java index 039f723..f87f257 100644 --- a/src/net/brysonsteck/Resurrection/PlayerListener.java +++ b/src/net/brysonsteck/Resurrection/PlayerListener.java @@ -1,5 +1,6 @@ package net.brysonsteck.Resurrection; +import org.bukkit.Bukkit; import org.bukkit.GameMode; import org.bukkit.Location; import org.bukkit.entity.Player; @@ -10,8 +11,10 @@ import org.bukkit.event.player.PlayerMoveEvent; import org.bukkit.event.player.PlayerRespawnEvent; import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; +import org.bukkit.plugin.java.JavaPlugin; -public class PlayerListener implements Listener { + +public class PlayerListener extends JavaPlugin implements Listener { @EventHandler public void onDeath(PlayerDeathEvent e) { @@ -31,17 +34,19 @@ public class PlayerListener implements Listener { @EventHandler public void onPlayerRespawn(PlayerRespawnEvent e) { - Player p = e.getPlayer(); + final Player p = e.getPlayer(); p.setGameMode(GameMode.ADVENTURE); - try { - Thread.sleep(1000); - } catch (InterruptedException interruptedException) { - interruptedException.printStackTrace(); - } - p.addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, 1728000, 10, false)); - p.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, 1728000, 10, false)); - p.addPotionEffect(new PotionEffect(PotionEffectType.SLOW, 1728000, 10, false)); - p.setNoDamageTicks(1728000); + + Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(getPlugin(Resurrection.class), new Runnable() + { + public void run() + { + p.addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, 1728000, 10, false)); + p.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, 1728000, 10, false)); + p.addPotionEffect(new PotionEffect(PotionEffectType.SLOW, 1728000, 10, false)); + p.setNoDamageTicks(1728000); + } + }, (1)); } @EventHandler diff --git a/src/net/brysonsteck/Resurrection/Resurrection.java b/src/net/brysonsteck/Resurrection/Resurrection.java index 33c5b99..23c0c4a 100644 --- a/src/net/brysonsteck/Resurrection/Resurrection.java +++ b/src/net/brysonsteck/Resurrection/Resurrection.java @@ -9,7 +9,7 @@ import org.bukkit.plugin.PluginDescriptionFile; import org.bukkit.plugin.java.JavaPlugin; public class Resurrection extends JavaPlugin { -// public Plugin plugin = getPlugin(Resurrection.class); + public Plugin plugin = getPlugin(Resurrection.class); //spigot things @Override