From f10b3cef0139049454305dde7c8dce89c91c5b8b Mon Sep 17 00:00:00 2001 From: GJ Date: Tue, 14 May 2013 12:42:18 -0400 Subject: [PATCH] Config option for escaping from the Kraken. --- src/main/java/com/gmail/nossr50/config/AdvancedConfig.java | 1 + .../com/gmail/nossr50/runnables/skills/KrakenAttackTask.java | 2 +- src/main/resources/advanced.yml | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/gmail/nossr50/config/AdvancedConfig.java b/src/main/java/com/gmail/nossr50/config/AdvancedConfig.java index 6c55bb360..01ace400d 100644 --- a/src/main/java/com/gmail/nossr50/config/AdvancedConfig.java +++ b/src/main/java/com/gmail/nossr50/config/AdvancedConfig.java @@ -284,6 +284,7 @@ public class AdvancedConfig extends AutoUpdateConfigLoader { /* KRAKEN STUFF */ public boolean getKrakenEnabled() { return config.getBoolean("Kraken.Enabled", true); } public boolean getKrakenGlobalSoundsEnabled() { return config.getBoolean("Kraken.Global_Sounds", true); } + public boolean getKrakenEscapeAllowed() { return config.getBoolean("Kraken.Allow_Escaping", false); } public int getKrakenTriesBeforeRelease() { return config.getInt("Kraken.Tries_Before_Release", 50); } public int getKrakenHealth() { return config.getInt("Kraken.Health", 50); } public String getKrakenName() { return config.getString("Kraken.Name", "The Kraken"); } diff --git a/src/main/java/com/gmail/nossr50/runnables/skills/KrakenAttackTask.java b/src/main/java/com/gmail/nossr50/runnables/skills/KrakenAttackTask.java index 51cbccba1..b8a3dcca7 100644 --- a/src/main/java/com/gmail/nossr50/runnables/skills/KrakenAttackTask.java +++ b/src/main/java/com/gmail/nossr50/runnables/skills/KrakenAttackTask.java @@ -64,7 +64,7 @@ public class KrakenAttackTask extends BukkitRunnable { if (player.isValid()) { Location location = player.getLocation(); - if (!location.getBlock().isLiquid()) { + if (!location.getBlock().isLiquid() && AdvancedConfig.getInstance().getKrakenEscapeAllowed()) { player.sendMessage(AdvancedConfig.getInstance().getPlayerEscapeMessage()); kraken.remove(); player.resetPlayerWeather(); diff --git a/src/main/resources/advanced.yml b/src/main/resources/advanced.yml index 0deffe2e8..780d3ac28 100644 --- a/src/main/resources/advanced.yml +++ b/src/main/resources/advanced.yml @@ -423,6 +423,7 @@ Kraken: Attack_Interval_Seconds: 1 Attack_Damage: 1 Global_Sounds: true + Allow_Escaping: false Unleashed_Message: Server: (PLAYER) has unleashed the kraken! Player: THE KRAKEN HAS BEEN UNLEASHED!