Merge pull request #139 from jedk1/master

Bug Fixes
This commit is contained in:
MistPhizzle 2015-06-10 04:25:17 -04:00
commit 42f2d706ef
6 changed files with 385 additions and 409 deletions

View file

@ -91,6 +91,7 @@ import com.projectkorra.ProjectKorra.airbending.AirSpout;
import com.projectkorra.ProjectKorra.airbending.AirSwipe;
import com.projectkorra.ProjectKorra.chiblocking.ChiMethods;
import com.projectkorra.ProjectKorra.chiblocking.Paralyze;
import com.projectkorra.ProjectKorra.configuration.ConfigManager;
import com.projectkorra.ProjectKorra.earthbending.EarthBlast;
import com.projectkorra.ProjectKorra.earthbending.EarthMethods;
import com.projectkorra.ProjectKorra.earthbending.EarthPassive;
@ -1334,6 +1335,7 @@ public class GeneralMethods {
public static void reloadPlugin() {
DBConnection.sql.close();
plugin.reloadConfig();
ConfigManager.deathMsgConfig.reloadConfig();
GeneralMethods.stopBending();
new AbilityModuleManager(plugin);
DBConnection.host = plugin.getConfig().getString("Storage.MySQL.host");

View file

@ -11,11 +11,6 @@ import org.bukkit.scheduler.BukkitRunnable;
import com.projectkorra.ProjectKorra.Ability.MultiAbility.MultiAbilityModule;
import com.projectkorra.ProjectKorra.Ability.MultiAbility.MultiAbilityModuleManager;
import com.projectkorra.ProjectKorra.airbending.AirMethods;
import com.projectkorra.ProjectKorra.chiblocking.ChiMethods;
import com.projectkorra.ProjectKorra.earthbending.EarthMethods;
import com.projectkorra.ProjectKorra.firebending.FireMethods;
import com.projectkorra.ProjectKorra.waterbending.WaterMethods;
public class MultiAbilityManager {
@ -102,28 +97,6 @@ public class MultiAbilityManager {
public void setSubElement(SubElement sub) {
this.sub = sub;
}
public ChatColor getAbilityColor() {
if (sub == null) {
switch (element) {
case Air:
return AirMethods.getAirColor();
case Water:
return WaterMethods.getWaterColor();
case Fire:
return FireMethods.getFireColor();
case Earth:
return EarthMethods.getEarthColor();
case Chi:
return ChiMethods.getChiColor();
default:
return GeneralMethods.getAvatarColor();
}
} else {
return GeneralMethods.getSubBendingColor(element);
}
}
}
/**
@ -165,18 +138,19 @@ public class MultiAbilityManager {
bPlayer.getAbilities().clear();
for (int i = 0; i < modes.size(); i++) {
if (!player.hasPermission("bending.ability." + multiAbility + "."
+ modes.get(i).getName()))
+ modes.get(i).getName())) {
bPlayer.getAbilities().put(
i + 1,
new StringBuilder()
.append(modes.get(i).getAbilityColor())
.append(GeneralMethods.getAbilityColor(modes.get(i).getName()))
.append(ChatColor.STRIKETHROUGH)
.append(modes.get(i).getName()).toString());
else
} else {
bPlayer.getAbilities()
.put(i + 1,
modes.get(i).getAbilityColor()
GeneralMethods.getAbilityColor(modes.get(i).getName())
+ modes.get(i).getName());
}
}
if (player.isOnline()) {

View file

@ -18,7 +18,7 @@ public class Config {
this.plugin = ProjectKorra.plugin;
this.file = new File(plugin.getDataFolder() + File.separator + file);
this.config = YamlConfiguration.loadConfiguration(this.file);
loadConfig();
reloadConfig();
}
public void createConfig() {
@ -47,7 +47,7 @@ public class Config {
return config;
}
public void loadConfig() {
public void reloadConfig() {
createConfig();
try {
config.load(file);

View file

@ -227,7 +227,7 @@ public class WaterArmsWhip {
return;
}
if (activeLength == whipLength && !grabbed) {
if (activeLength >= whipLength && !grabbed) {
reverting = true;
}

View file

@ -45,7 +45,7 @@ public class WaterManipulation {
// private static double speed = 1.5;
private static int ID = Integer.MIN_VALUE;
private static final byte full = 0x8;
private static final byte full = 0x0;
private static HashSet<Byte> water = new HashSet<Byte>();
// private static final byte half = 0x4;
@ -526,7 +526,7 @@ public class WaterManipulation {
&& EarthMethods.isTransparentToEarthbending(player, eyeloc.getBlock())) {
if (getTargetLocation(player).distance(block.getLocation()) > 1) {
block.setType(Material.STATIONARY_WATER);
block.setType(Material.WATER);
block.setData(full);
WaterManipulation watermanip = new WaterManipulation(player);
watermanip.moveWater();

View file

@ -31,7 +31,7 @@ public class WaterMethods {
static ProjectKorra plugin;
private static FileConfiguration config = ProjectKorra.plugin.getConfig();
private static Integer[] plantIds = { 6, 18, 31, 32, 37, 38, 39, 40, 59, 81, 83, 86, 99, 100, 103, 104, 105, 106, 111, 161, 175};
private static Integer[] plantIds = { 6, 18, 31, 37, 38, 39, 40, 59, 81, 83, 86, 99, 100, 103, 104, 105, 106, 111, 161, 175};
public WaterMethods(ProjectKorra plugin) {
WaterMethods.plugin = plugin;