From ca293fdd294eea0fb5784f65d467292fd0361ee4 Mon Sep 17 00:00:00 2001 From: Boosik Date: Fri, 15 Mar 2013 11:44:48 +0100 Subject: [PATCH] Added potion effects on warmup, /bcd alias --- .../boosCooldown/boosConfigManager.class | Bin 17820 -> 18584 bytes .../boosCooldown/boosCoolDownListener.class | Bin 11924 -> 12036 bytes .../boosCooldown/boosWarmUpManager.class | Bin 4514 -> 5296 bytes bin/plugin.yml | 3 ++- .../boosCooldown/boosConfigManager.java | 16 ++++++++++++++++ .../boosCooldown/boosCoolDownListener.java | 1 + .../boosCooldown/boosWarmUpManager.java | 9 +++++++++ src/plugin.yml | 3 ++- 8 files changed, 30 insertions(+), 2 deletions(-) diff --git a/bin/cz/boosik/boosCooldown/boosConfigManager.class b/bin/cz/boosik/boosCooldown/boosConfigManager.class index 38160db7a8559fc21f079c28ab4d7c76e9abb543..a5c43a9fd73bea7c886626eeb2acf3cee57f8da2 100644 GIT binary patch delta 1740 zcma)7U1%It6u$S|Niw@lnn|adO_Maa*`FkBCc90xR_$+QlgaM1$!xl_X^3LOm`vJj zcXyWkF$R>CD!vpHodvU0JDza};M(U5%@AYGzrYCl}`zB&w;2WM;+Dr!4jBaFeIcgM(xlOuZ8W#&@xlC16r4@@7 zbH*kM<~UZ)n{=&OGMu-h);g`fZG;C8M*WYTtXRt0mjj-TNVHruHVQoKz^Koz1$=f# zfX5y7OMxCc67b+o7cDT<N(9Z2?kcW))ZIce> zx1F1Zz4k^ig$qxMa!TGEWXnKVl#4`Ud$)EgDXG2)_b$f%>NyH8*=WZw++j%=s!LJXd0gM%0e z7mOE-Xtk2fMdeb-*etihA$Zb$HWb58+i!+^!$(-MXqnBxbbVNOIEGP2)M8~WJyM;p zZ-mA;nHAWc2>a}vVUK^B#g1B~?73{g$UVBcVn@QGIAJe^zntzoXI7d=jt8CHa@+K= zGl@}ay=`p&@M#?1$_{_w_tX%_KE#b~O&q@kH4#6!hHrn2`b0n?Km&6kv^Fp=c(3ED z4dxYgH?ekMw2AE$o@ru&u-e3Sb-_Rr-A!CltEcW3)|&Qugvln>E9_`u{Vh#oKm^)2 zSD*=pn((j)qs*rDGxXXr5n;c+%dgIoY#LIn8{g0twIt~$xkp!{(ybtFDCE7e)2brk^4+O0EzR$ zI43}aRb-s&hA1}(2e=?ia3c^yJ?s}yL_3^Tfh4GmIp`#uvcH-+;k${_FbDGp$UPJR zjUmDXZNGA)9Xi|aB@THY1q=3BW$eHqHxw{`51dB52%}DhFR(6jbOAiK{~CJr6szl} zXz#KJY5SX4uiT4TSrrc>fFr04j-oy|hWeSLaNG^oU3W%rph*@4m_EZ0Mi>?y4rl%W DIgz;^ delta 983 zcmZXTOH30{6o&8p&lIMmz~E3?p_CT-(n3c8ANWE9shEI?#0Bm~s8TI0DIn^G#27bX zjNXljx^%(HC<#I1BXMO^V$=nROQUWyn&{F9-j=G9n8}>~eE0ry&Y8KH>sR^BOWg5% z<-uddSSu2D9WMfY?{Ic(%*>2T#K&`~;bc+b#>BWeol*I!_|W9%T-bsEP9h?sP4vlF zDo)907ng%gyiD8;26?%R9`QBk8eA zi*(4x*URW}Oq;oJ6?L2iMKO+IV(4^lcUK$Q>tha_roz|3uj*8kGRCIu-&~aUoD$Uok(TO z^xyB%A?hPhzEku@o{IkHA>K8AEBeH3H<%(XrYQ5ty{|B%ITrct1^(t9tJC?4R{f8_ zw5Wxk9kr064O^(B3O);}WC4dZVj-v2YM}~krp$tx%>wImR2Sz$jV1S3@>(5U=_z@{ zE)0wbc$y2Ic)_!2aG)0XA z^z>=;lUDe7M$F9^TG{OU>z>%Amr|F|NN>?Z%TnJVNS_d*F9_2& zsoxO^(@#Wc6&n;njCte_H_poPM~hw9Eh(SvL8nM0I$d+@F!rL0ftFYt`(#G6DsCip eI{D{PeqLdAbfZVSPsH?ip%mov9Q$PidVd4TEAf#4 diff --git a/bin/cz/boosik/boosCooldown/boosCoolDownListener.class b/bin/cz/boosik/boosCooldown/boosCoolDownListener.class index d1207ffb911ce7f5938fe37a338cb40e16abbfe4..118aa941e5963f874e18bf535d367d623a9ecc74 100644 GIT binary patch delta 269 zcmbOd+Y%>m>ff$?3=9lLj2qb*m>3zfCnriMPoB@rvC+CmLVsTsz_V8XbDhjH!Za}tL|jQ=vQGOz*7 z_0iFlWZA(uZx(|-gylGsL0)SMgEojK%DRJbA&jwn@@`!PuhkoYnphZQfutP+KLZ0} zHv<=A4}%C}FM||gAA=l_R%GmF&|;jxpwBpw!GLixgDK+_1~bO#40en&7@QerGPp3# yX7Fa5Gx?5&DeoqRY@lgCXE1DL$eS#uDJj9qz-++E3-szbpfD5TdInxFy#WBpmpzXF delta 280 zcmXYsyGjEA5Jk`3hY?A{B1$3{6mb`lY%rqD1_bpx6l@j5Kd`YgK5)fH1jWiXxW*z_ z*x30set|e{EN1SxFqfIxT{~GF`TBYP0Os_Z!x6P)y)>O%yMt+~UCJ@9yS(nZ&GKil z`i;+kjjq(Ave(m9hoDbO7mQWksQtN7zo(ldY)tOlrZ(#_VLfITw8xOz6t&N|4yc$; z>5xE2ggU0Kgh;0>=!{tBwA5i)msBjj*xyS;!<=2f3n|KIh5#p{4K{HzdNqo@47+UE d*|Wy^|3F03+_sgE8~O$N`oWB&M+%uf{Q|BhF9QGo diff --git a/bin/cz/boosik/boosCooldown/boosWarmUpManager.class b/bin/cz/boosik/boosCooldown/boosWarmUpManager.class index 5fac2252b602b916e0adbe01a48d06fa22db2d70..f03bdfb0c0f0d04d8195bf890b1f2cd5f66be49b 100644 GIT binary patch delta 934 zcmaiy*-KPW9LGP$SzP9hG$Xg1|TP1+)*)s(i{re@um+cY)lWK-aiM9@P) z5C`h12SbRSDuT!!0;8AqeK&323;F|!epx}i7zgg}{?6~aoclfZ=(v-?oXg+Ood>G; zoKBh|pnIH!`lfQ93b(p^UNf0YbS>#f#XH*TH*K;urWCXFS5>HooWbIKTs64Hb%iHp zrT#^Y59t2%Jl&CzTad*BZW`R;w!*O^nTU%>+3;Ak=&`o^+PmCO=boaZqcaxTuygCy zcq)_}_6+?k+SHY_3?A@Mktu$&yB3+-EJb)&s;S}s`g?Ed&%M2yV_E;#= zp0Z+Ar@>PO6&XphbB85+3g57BcO;9uJTrLC3x%<<(=t=mpDaoPkx1}A&NVJ3^UB~g zZzL!)8vXm56s3WY`MIf@=3ukJ`704cUW=aO$ggx-zwe`TWPa*rZ2F*Ufy&eau1St; zvdGb1qe>aN&e-kG!yq3IKBiDWHKVANKEh}{XdLqv;is4|V`Ngq97^;d_g;4y4g!=D zl$)*4!R%h|RKbO1O=B)oS{kwNY0I!~kOt`kZ`H1QQ@1E{Vfm}x6mf!xc9Lp&+RB@IoxiijiquTDb+p5lTr`l2O zcNFCWHv8>%=^xpnXBe{g@zTbsQ$k6T$RHQHJU8PaF0pN4A_<8RX8w|u^RAFi33L=e9KLAvR?F;|_ delta 311 zcmWNLKTASk6o;QzxMtbC*P9t!vLJ#oDF_FXiV93`R`%D3%1VhoKx>PH;1V?S&JBhT z4N}omgHubk^hx>#R);e@9M13eaGodbM?>x3_ZE=gs|%kZrtAJe{jJQGR57SKrl$fr zV@(?-J=prvN~oZ2T32o#y@avpCrN}^23V3khpRpN!HMEBM2ca#L`gHE|LmGMhQT;- zVoVa(x1olUl-!KuQe?%m$(;6_vavvb#n+~jSCzC>mT}04Dl27=DOTj!9P_NQCUd|# z$K)vq&)MKYG!?d}vQ15R%?>y0az}wWdo+ZP?DHheHx6lW#E0;cB0pm4aH8N;8I+Xm Rr>r8J=}NfTtt0|I+W)PAJkS6D diff --git a/bin/plugin.yml b/bin/plugin.yml index 4209b63..0fbdbd8 100644 --- a/bin/plugin.yml +++ b/bin/plugin.yml @@ -1,6 +1,6 @@ name: boosCooldowns main: cz.boosik.boosCooldown.boosCoolDown -version: 3.3.0 +version: 3.4.0 authors: [LordBoos (ingame name boosik)] softdepend: [Vault] description: > @@ -9,6 +9,7 @@ commands: booscooldowns: description: Reload command. usage: Use /booscooldowns reload, clearcooldowns , clearwarmups or clearuses + aliases: bcd permissions: booscooldowns.exception: description: Player wont be affected by plugin at all (no warmups, no cooldowns, no prices, no limits, no aliases). diff --git a/src/cz/boosik/boosCooldown/boosConfigManager.java b/src/cz/boosik/boosCooldown/boosConfigManager.java index cb87a67..1e1f59f 100644 --- a/src/cz/boosik/boosCooldown/boosConfigManager.java +++ b/src/cz/boosik/boosCooldown/boosConfigManager.java @@ -522,6 +522,14 @@ public class boosConfigManager { conf.addDefault("commands.warmups.warmup3./home", 90); conf.addDefault("commands.warmups.warmup4./home", 99); conf.addDefault("commands.warmups.warmup5./home", 542); + conf.addDefault("commands.warmupPotionEffects.effect./home", + "WEAKNESS@3"); + conf.addDefault( + "commands.warmupPotionEffects.howto1", + "#You can use CONFUSION, DAMAGE_RESISTANCE, FAST_DIGGING, FIRE_RESISTANCE, HARM, HEAL, HUNGER, INCREASE_DAMAGE, INVISIBILITY, JUMP, NIGHT_VISION, POISON, REGENERATION, SLOW, SLOW_DIGGING, SPEED, WATER_BREATHING, WEAKNESS, WITHER"); + conf.addDefault( + "commands.warmupPotionEffects.howto2", + "#After effect add @number, for example WEAKNESS@3 will apply weakness III to player for the duration of warmup."); conf.addDefault("commands.prices.price./spawn", 10); conf.addDefault("commands.prices.price./home", 20); conf.addDefault("commands.prices.price2./home", 40); @@ -557,4 +565,12 @@ public class boosConfigManager { public static int getSaveInterval() { return conf.getInt("options.options.save_interval_in_minutes", 15); } + + public static String getPotionEffect(String pre) { + String effect = null; + pre = pre.toLowerCase(); + effect = conf.getString("commands.warmupPotionEffects.effect." + pre, + effect); + return effect; + } } diff --git a/src/cz/boosik/boosCooldown/boosCoolDownListener.java b/src/cz/boosik/boosCooldown/boosCoolDownListener.java index 69c98ff..4d3831a 100644 --- a/src/cz/boosik/boosCooldown/boosCoolDownListener.java +++ b/src/cz/boosik/boosCooldown/boosCoolDownListener.java @@ -396,6 +396,7 @@ public class boosCoolDownListener implements Listener { if (boosCoolDownManager.checkCoolDownOK(player, pre, message)) { boosWarmUpManager.startWarmUp(this.plugin, player, pre, message, warmUpSeconds); + boosWarmUpManager.applyPotionEffect(player, pre, message, warmUpSeconds); event.setCancelled(true); return; } else { diff --git a/src/cz/boosik/boosCooldown/boosWarmUpManager.java b/src/cz/boosik/boosCooldown/boosWarmUpManager.java index 657942d..3302bbb 100644 --- a/src/cz/boosik/boosCooldown/boosWarmUpManager.java +++ b/src/cz/boosik/boosCooldown/boosWarmUpManager.java @@ -5,6 +5,7 @@ import java.util.Timer; import java.util.concurrent.ConcurrentHashMap; import org.bukkit.entity.Player; +import org.bukkit.potion.PotionEffectType; import util.boosChat; @@ -97,4 +98,12 @@ public class boosWarmUpManager { boosChat.sendMessageToPlayer(player, msg); } } + + public static void applyPotionEffect(Player player, String pre, + String message, int warmUpSeconds) { + String[] potion = boosConfigManager.getPotionEffect(pre).split("@"); + PotionEffectType effect = PotionEffectType.getByName(potion[0]); + player.addPotionEffect(effect.createEffect(warmUpSeconds*40, Integer.parseInt(potion[1])-1), true); + + } } diff --git a/src/plugin.yml b/src/plugin.yml index 4209b63..0fbdbd8 100644 --- a/src/plugin.yml +++ b/src/plugin.yml @@ -1,6 +1,6 @@ name: boosCooldowns main: cz.boosik.boosCooldown.boosCoolDown -version: 3.3.0 +version: 3.4.0 authors: [LordBoos (ingame name boosik)] softdepend: [Vault] description: > @@ -9,6 +9,7 @@ commands: booscooldowns: description: Reload command. usage: Use /booscooldowns reload, clearcooldowns , clearwarmups or clearuses + aliases: bcd permissions: booscooldowns.exception: description: Player wont be affected by plugin at all (no warmups, no cooldowns, no prices, no limits, no aliases).