From 693f3f61eb676f3ae6ff8b35869a09e64cfaa137 Mon Sep 17 00:00:00 2001 From: Loony Date: Fri, 29 Jul 2016 19:21:55 +0100 Subject: [PATCH] Adds config option to Bending Preview (#526) * Fixes NPE with surge wave & bottles * Fixed bracket :S For some reason it PR'd my bracket and code separate? Weird. * Changed dayfactor placement so that it's correct with avatar state factor * Added config option for Bending Preview --- src/com/projectkorra/projectkorra/GeneralMethods.java | 2 ++ .../projectkorra/projectkorra/configuration/ConfigManager.java | 1 + 2 files changed, 3 insertions(+) diff --git a/src/com/projectkorra/projectkorra/GeneralMethods.java b/src/com/projectkorra/projectkorra/GeneralMethods.java index a576addd..6e1da99e 100644 --- a/src/com/projectkorra/projectkorra/GeneralMethods.java +++ b/src/com/projectkorra/projectkorra/GeneralMethods.java @@ -563,6 +563,7 @@ public class GeneralMethods { String displayedMessage = null; BendingPlayer bPlayer = BendingPlayer.getBendingPlayer(player); + if (ConfigManager.defaultConfig.get().getBoolean("Properties.BendingPreview") == true) { if (ability != null) { if (bPlayer.isOnCooldown(ability)) { displayedMessage = ability.getElement().getColor() + "" + ChatColor.STRIKETHROUGH + ability.getName(); @@ -575,6 +576,7 @@ public class GeneralMethods { ActionBar.sendActionBar(displayedMessage, player); } + } public static List getBlocksAlongLine(Location ploc, Location tloc, World w) { List blocks = new ArrayList(); diff --git a/src/com/projectkorra/projectkorra/configuration/ConfigManager.java b/src/com/projectkorra/projectkorra/configuration/ConfigManager.java index 8051f6d8..bd26c8f1 100644 --- a/src/com/projectkorra/projectkorra/configuration/ConfigManager.java +++ b/src/com/projectkorra/projectkorra/configuration/ConfigManager.java @@ -397,6 +397,7 @@ public class ConfigManager { ArrayList snowBlocks = new ArrayList<>(); snowBlocks.add("SNOW"); + config.addDefault("Properties.BendingPreview", true); config.addDefault("Properties.ImportEnabled", true); config.addDefault("Properties.BendingAffectFallingSand.Normal", true); config.addDefault("Properties.BendingAffectFallingSand.NormalStrengthMultiplier", 1.0);