General fixes

fixes
This commit is contained in:
Benford 2015-09-26 12:17:45 -04:00
parent bc54ed22a0
commit b7c521bda2
4 changed files with 52 additions and 8 deletions

View file

@ -110,6 +110,7 @@ import com.projectkorra.projectkorra.earthbending.SandSpout;
import com.projectkorra.projectkorra.earthbending.Shockwave;
import com.projectkorra.projectkorra.earthbending.Tremorsense;
import com.projectkorra.projectkorra.event.PlayerBendingDeathEvent;
import com.projectkorra.projectkorra.event.PlayerChangeElementEvent;
import com.projectkorra.projectkorra.firebending.ArcOfFire;
import com.projectkorra.projectkorra.firebending.Combustion;
import com.projectkorra.projectkorra.firebending.Enflamed;
@ -174,23 +175,31 @@ public class PKListener implements Listener {
Preset.loadPresets(player);
String append = "";
ChatColor color = null;
boolean chatEnabled = ProjectKorra.plugin.getConfig().getBoolean("Properties.Chat.Enable");
if ((player.hasPermission("bending.avatar") || GeneralMethods.getBendingPlayer(player.getName()).getElements().size() > 1) && chatEnabled) {
append = plugin.getConfig().getString("Properties.Chat.Prefixes.Avatar");
color = ChatColor.valueOf(plugin.getConfig().getString("Properties.Chat.Colors.Avatar"));
} else if (GeneralMethods.isBender(player.getName(), Element.Air) && chatEnabled) {
append = plugin.getConfig().getString("Properties.Chat.Prefixes.Air");
color = AirMethods.getAirColor();
} else if (GeneralMethods.isBender(player.getName(), Element.Water) && chatEnabled) {
append = plugin.getConfig().getString("Properties.Chat.Prefixes.Water");
color = WaterMethods.getWaterColor();
} else if (GeneralMethods.isBender(player.getName(), Element.Earth) && chatEnabled) {
append = plugin.getConfig().getString("Properties.Chat.Prefixes.Earth");
color = EarthMethods.getEarthColor();
} else if (GeneralMethods.isBender(player.getName(), Element.Fire) && chatEnabled) {
append = plugin.getConfig().getString("Properties.Chat.Prefixes.Fire");
color = FireMethods.getFireColor();
} else if (GeneralMethods.isBender(player.getName(), Element.Chi) && chatEnabled) {
append = plugin.getConfig().getString("Properties.Chat.Prefixes.Chi");
color = ChiMethods.getChiColor();
}
if (chatEnabled) {
player.setDisplayName(append + player.getDisplayName());
player.setDisplayName(player.getName());
player.setDisplayName(color + append + ChatColor.RESET + player.getDisplayName());
}
// Handle the AirSpout/WaterSpout login glitches
@ -344,6 +353,39 @@ public class PKListener implements Listener {
event.setCancelled(true);
}
}
@EventHandler(priority = EventPriority.NORMAL)
public void onElementChange(PlayerChangeElementEvent event) {
Player player = event.getTarget();
Element e = event.getElement();
String append = "";
ChatColor color = null;
boolean chatEnabled = ProjectKorra.plugin.getConfig().getBoolean("Properties.Chat.Enable");
if (GeneralMethods.getBendingPlayer(player).getElements().size() > 1) {
append = plugin.getConfig().getString("Properties.Chat.Prefixes.Avatar");
color = ChatColor.valueOf(plugin.getConfig().getString("Properties.Chat.Colors.Avatar"));
} else if (e == Element.Air && chatEnabled) {
append = plugin.getConfig().getString("Properties.Chat.Prefixes.Air");
color = AirMethods.getAirColor();
} else if (e == Element.Water && chatEnabled) {
append = plugin.getConfig().getString("Properties.Chat.Prefixes.Water");
color = WaterMethods.getWaterColor();
} else if (e == Element.Earth && chatEnabled) {
append = plugin.getConfig().getString("Properties.Chat.Prefixes.Earth");
color = EarthMethods.getEarthColor();
} else if (e == Element.Fire && chatEnabled) {
append = plugin.getConfig().getString("Properties.Chat.Prefixes.Fire");
color = FireMethods.getFireColor();
} else if (e == Element.Chi && chatEnabled) {
append = plugin.getConfig().getString("Properties.Chat.Prefixes.Chi");
color = ChiMethods.getChiColor();
}
if (chatEnabled) {
player.setDisplayName(player.getName());
player.setDisplayName(color + append + ChatColor.RESET + player.getDisplayName());
}
}
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
public void onEntityChangeBlockEvent(EntityChangeBlockEvent event) {

View file

@ -136,10 +136,9 @@ public class ComboManager {
iceBullet.add(new AbilityInformation("WaterBubble", ClickType.SHIFT_DOWN));
iceBullet.add(new AbilityInformation("WaterBubble", ClickType.SHIFT_UP));
iceBullet.add(new AbilityInformation("IceBlast", ClickType.SHIFT_DOWN));
iceBullet.add(new AbilityInformation("IceBlast", ClickType.LEFT_CLICK));
comboAbilityList.put("IceBullet", new ComboAbility("IceBullet", iceBullet, WaterCombo.class));
descriptions.put("IceBullet", "Using a large cavern of ice, you can punch ice shards at your opponent causing moderate damage. To rapid fire, you must alternate between Left clicking and right clicking with IceBlast.");
instructions.put("IceBullet", "WaterBubble (Tap Shift) > IceBlast (Hold Shift) > IceBlast (Left Click) > Wait for ice to Form > Then alternate between Left and Right click with IceBlast");
instructions.put("IceBullet", "WaterBubble (Tap Shift) > IceBlast (Hold Shift) > Wait for ice to Form > Then alternate between Left and Right click with IceBlast");
ArrayList<AbilityInformation> iceBulletLeft = new ArrayList<AbilityInformation>();
iceBulletLeft.add(new AbilityInformation("IceBlast", ClickType.LEFT_CLICK));

View file

@ -36,7 +36,8 @@ public class AirBlast extends CoreAbility {
public static double speed = config.get().getDouble("Abilities.Air.AirBlast.Speed");
public static double defaultrange = config.get().getDouble("Abilities.Air.AirBlast.Range");
public static double affectingradius = config.get().getDouble("Abilities.Air.AirBlast.Radius");
public static double defaultpushfactor = config.get().getDouble("Abilities.Air.AirBlast.Push");
public static double defaultpushfactor = config.get().getDouble("Abilities.Air.AirBlast.Push.Entities");
public static double otherpushfactor = config.get().getDouble("Abilities.Air.AirBlast.Push.Self");
public static boolean flickLevers = config.get().getBoolean("Abilities.Air.AirBlast.CanFlickLevers");
public static boolean openDoors = config.get().getBoolean("Abilities.Air.AirBlast.CanOpenDoors");
@ -185,6 +186,7 @@ public class AirBlast extends CoreAbility {
boolean isUser = entity.getUniqueId() == player.getUniqueId();
if (!isUser || otherorigin) {
pushfactor = otherpushfactor;
Vector velocity = entity.getVelocity();
// double mag = Math.abs(velocity.getY());
double max = maxspeed;

View file

@ -202,14 +202,15 @@ public class ConfigManager {
config.addDefault("Abilities.Air.AirBlast.Speed", 25);
config.addDefault("Abilities.Air.AirBlast.Range", 20);
config.addDefault("Abilities.Air.AirBlast.Radius", 2);
config.addDefault("Abilities.Air.AirBlast.Push", 2.5);
config.addDefault("Abilities.Air.AirBlast.Push.Self", 2.5);
config.addDefault("Abilities.Air.AirBlast.Push.Entities", 3.5);
config.addDefault("Abilities.Air.AirBlast.CanFlickLevers", true);
config.addDefault("Abilities.Air.AirBlast.CanOpenDoors", true);
config.addDefault("Abilities.Air.AirBlast.CanPressButtons", true);
config.addDefault("Abilities.Air.AirBlast.CanCoolLava", true);
config.addDefault("Abilities.Air.AirBubble.Enabled", true);
config.addDefault("Abilities.Air.AirBubble.Description", "To use, the bender must merely have the ability selected. All water around the user in a small bubble will vanish, replacing itself once the user either gets too far away or selects a different ability.");
config.addDefault("Abilities.Air.AirBubble.Description", "To use, the bender must hold down sneak. All water around the user in a small bubble will vanish, replacing itself once the user either gets too far away or selects a different ability.");
config.addDefault("Abilities.Air.AirBubble.Radius", 7);
config.addDefault("Abilities.Air.AirBurst.Enabled", true);
@ -435,7 +436,7 @@ public class ConfigManager {
config.addDefault("Abilities.Water.WaterArms.Spear.NightAugments.Duration.FullMoon", 12000);
config.addDefault("Abilities.Water.WaterBubble.Enabled", true);
config.addDefault("Abilities.Water.WaterBubble.Description", "To use, the bender must merely have the ability selected. All water around the user in a small bubble will vanish, replacing itself once the user either gets too far away or selects a different ability.");
config.addDefault("Abilities.Water.WaterBubble.Description", "To use, the bender must hold down sneak. All water around the user in a small bubble will vanish, replacing itself once the user either gets too far away or selects a different ability.");
config.addDefault("Abilities.Water.WaterBubble.Radius", 7);
config.addDefault("Abilities.Water.WaterManipulation.Enabled", true);