diff --git a/bin/cz/boosik/boosCooldown/boosConfigManager.class b/bin/cz/boosik/boosCooldown/boosConfigManager.class index 38160db..a5c43a9 100644 Binary files a/bin/cz/boosik/boosCooldown/boosConfigManager.class and b/bin/cz/boosik/boosCooldown/boosConfigManager.class differ diff --git a/bin/cz/boosik/boosCooldown/boosCoolDownListener.class b/bin/cz/boosik/boosCooldown/boosCoolDownListener.class index d1207ff..118aa94 100644 Binary files a/bin/cz/boosik/boosCooldown/boosCoolDownListener.class and b/bin/cz/boosik/boosCooldown/boosCoolDownListener.class differ diff --git a/bin/cz/boosik/boosCooldown/boosWarmUpManager.class b/bin/cz/boosik/boosCooldown/boosWarmUpManager.class index 5fac225..f03bdfb 100644 Binary files a/bin/cz/boosik/boosCooldown/boosWarmUpManager.class and b/bin/cz/boosik/boosCooldown/boosWarmUpManager.class differ 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).