From 848b61f65d82dd46344679ecb71409342eeb5ddb Mon Sep 17 00:00:00 2001 From: MistPhizzle Date: Tue, 29 Jul 2014 10:15:35 -0400 Subject: [PATCH] Make Air Particles Configurable Defaults to smoke (White Clouds) Other options are: blacksmoke (The original Airbending Particles) spell (the swirly potion particles) --- .classpath | 23 +++++------ .../ProjectKorra/ConfigManager.java | 1 + .../projectkorra/ProjectKorra/Methods.java | 39 +++++++++++++++---- src/config.yml | 1 + 4 files changed, 43 insertions(+), 21 deletions(-) diff --git a/.classpath b/.classpath index 0c4a5353..e5f10002 100644 --- a/.classpath +++ b/.classpath @@ -2,18 +2,15 @@ - - - - - - - - - - - - - + + + + + + + + + + diff --git a/src/com/projectkorra/ProjectKorra/ConfigManager.java b/src/com/projectkorra/ProjectKorra/ConfigManager.java index 66aab8f7..c2cb32a5 100644 --- a/src/com/projectkorra/ProjectKorra/ConfigManager.java +++ b/src/com/projectkorra/ProjectKorra/ConfigManager.java @@ -64,6 +64,7 @@ public class ConfigManager { config.addDefault("Properties.RegionProtection.RespectPreciousStones", true); config.addDefault("Properties.Air.CanBendWithWeapons", false); + config.addDefault("Properties.Air.Particles", "smoke"); config.addDefault("Properties.Water.CanBendWithWeapons", true); config.addDefault("Properties.Water.NightFactor", 1.5); diff --git a/src/com/projectkorra/ProjectKorra/Methods.java b/src/com/projectkorra/ProjectKorra/Methods.java index dedd3634..6dd7a50c 100644 --- a/src/com/projectkorra/ProjectKorra/Methods.java +++ b/src/com/projectkorra/ProjectKorra/Methods.java @@ -292,7 +292,7 @@ public class Methods { if (player.hasPermission("bending.earth.metalbending")) return true; return false; } - + /** * Checks to see if a player can PlantBend. * @param player The player to check @@ -301,7 +301,7 @@ public class Methods { public static boolean canPlantbend(Player player) { return player.hasPermission("bending.ability.plantbending"); } - + /** * Creates a {@link BendingPlayer} with the data from the database. This runs when a player logs in. * @param uuid The UUID of the player @@ -353,7 +353,7 @@ public class Methods { ex.printStackTrace(); } } - + /** * Damages an Entity by amount of damage specified. Starts a {@link EntityDamageByEntityEvent}. * @param player The player dealing the damage @@ -1152,10 +1152,10 @@ public class Methods { if (fcp != null && mcore != null && respectFactions) { if (!FactionsListenerMain.canPlayerBuildAt(player, PS.valueOf(loc.getBlock()), false)) { - return true; + return true; } else { - return false; - } + return false; + } } if (twnp != null && respectTowny) { @@ -1472,8 +1472,31 @@ public class Methods { } public static void playAirbendingParticles(Location loc) { - for (int i = 0; i < 20; i++) { - ParticleEffect.CLOUD.display(loc, (float) Math.random(), (float) Math.random(), (float) Math.random(), 0, 1); + String particle = plugin.getConfig().getString("Properties.Air.Particles"); + if (particle == null) { + for (int i = 0; i < 20; i++) { + ParticleEffect.CLOUD.display(loc, (float) Math.random(), (float) Math.random(), (float) Math.random(), 0, 1); + } + } + else if (particle.equalsIgnoreCase("spell")) { + for (int i = 0; i < 20; i++) { + ParticleEffect.SPELL.display(loc, (float) Math.random(), (float) Math.random(), (float) Math.random(), 0, 1); + } + } + else if (particle.equalsIgnoreCase("blacksmoke")) { + for (int i = 0; i < 20; i++) { + ParticleEffect.SMOKE.display(loc, (float) Math.random(), (float) Math.random(), (float) Math.random(), 0, 1); + } + } + else if (particle.equalsIgnoreCase("smoke")) { + for (int i = 0; i < 20; i++) { + ParticleEffect.CLOUD.display(loc, (float) Math.random(), (float) Math.random(), (float) Math.random(), 0, 1); + } + } + else { + for (int i = 0; i < 20; i++) { + ParticleEffect.CLOUD.display(loc, (float) Math.random(), (float) Math.random(), (float) Math.random(), 0, 1); + } } } diff --git a/src/config.yml b/src/config.yml index 1d2d61a7..380ca33f 100644 --- a/src/config.yml +++ b/src/config.yml @@ -34,6 +34,7 @@ Properties: RespectPreciousStones: true Air: CanBendWithWeapons: false + Particles: smoke Water: CanBendWithWeapons: false NightFactor: 1.5