mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2025-02-11 11:40:40 +00:00
Give Metalbending its own color
This color is configurable (Defaults: Dark Green). Will display abilities in /bending display and their descriptions in this color if they are metalbending abilities.
This commit is contained in:
parent
bbece259e1
commit
4f2a59f942
6 changed files with 42 additions and 3 deletions
|
@ -27,6 +27,7 @@ public class AbilityModuleManager {
|
||||||
public static HashSet<String> harmlessabilities;
|
public static HashSet<String> harmlessabilities;
|
||||||
public static HashSet<String> igniteabilities;
|
public static HashSet<String> igniteabilities;
|
||||||
public static HashSet<String> explodeabilities;
|
public static HashSet<String> explodeabilities;
|
||||||
|
public static HashSet<String> metalbendingabilities;
|
||||||
|
|
||||||
public static HashMap<String, String> descriptions;
|
public static HashMap<String, String> descriptions;
|
||||||
|
|
||||||
|
@ -49,6 +50,7 @@ public class AbilityModuleManager {
|
||||||
harmlessabilities = new HashSet<String>();
|
harmlessabilities = new HashSet<String>();
|
||||||
explodeabilities = new HashSet<String>();
|
explodeabilities = new HashSet<String>();
|
||||||
igniteabilities = new HashSet<String>();
|
igniteabilities = new HashSet<String>();
|
||||||
|
metalbendingabilities = new HashSet<String>();
|
||||||
ability = loader.load(AbilityModule.class);
|
ability = loader.load(AbilityModule.class);
|
||||||
fill();
|
fill();
|
||||||
}
|
}
|
||||||
|
|
|
@ -255,9 +255,13 @@ public class Commands {
|
||||||
}
|
}
|
||||||
for (String st: AbilityModuleManager.earthbendingabilities) {
|
for (String st: AbilityModuleManager.earthbendingabilities) {
|
||||||
if (Methods.hasPermission((Player) s, st)) {
|
if (Methods.hasPermission((Player) s, st)) {
|
||||||
|
if (Methods.isMetalbendingAbility(st)) {
|
||||||
|
s.sendMessage(Methods.getMetalbendingColor() + st);
|
||||||
|
} else {
|
||||||
s.sendMessage(Methods.getEarthColor() + st);
|
s.sendMessage(Methods.getEarthColor() + st);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (Arrays.asList(firealiases).contains(args[1].toLowerCase())) {
|
if (Arrays.asList(firealiases).contains(args[1].toLowerCase())) {
|
||||||
|
@ -361,6 +365,9 @@ public class Commands {
|
||||||
s.sendMessage(Methods.getWaterColor() + "- Waterbender");
|
s.sendMessage(Methods.getWaterColor() + "- Waterbender");
|
||||||
}
|
}
|
||||||
if (Methods.isBender(un, Element.Earth)) {
|
if (Methods.isBender(un, Element.Earth)) {
|
||||||
|
if (Methods.canMetalbend(p)) {
|
||||||
|
s.sendMessage(Methods.getEarthColor() + "- Earthbender " + Methods.getMetalbendingColor() + "(Can Metalbend)");
|
||||||
|
}
|
||||||
s.sendMessage(Methods.getEarthColor() + "- Earthbender");
|
s.sendMessage(Methods.getEarthColor() + "- Earthbender");
|
||||||
}
|
}
|
||||||
if (Methods.isBender(un, Element.Fire)) {
|
if (Methods.isBender(un, Element.Fire)) {
|
||||||
|
@ -770,9 +777,14 @@ public class Commands {
|
||||||
s.sendMessage(Methods.getWaterColor() + AbilityModuleManager.descriptions.get(ability));
|
s.sendMessage(Methods.getWaterColor() + AbilityModuleManager.descriptions.get(ability));
|
||||||
}
|
}
|
||||||
else if (Methods.isEarthAbility(ability)) {
|
else if (Methods.isEarthAbility(ability)) {
|
||||||
|
if (Methods.isMetalbendingAbility(ability)) {
|
||||||
|
s.sendMessage(Methods.getMetalbendingColor() + ability + " - ");
|
||||||
|
s.sendMessage(Methods.getMetalbendingColor() + AbilityModuleManager.descriptions.get(ability));
|
||||||
|
} else {
|
||||||
s.sendMessage(Methods.getEarthColor() + ability + " - ");
|
s.sendMessage(Methods.getEarthColor() + ability + " - ");
|
||||||
s.sendMessage(Methods.getEarthColor() + AbilityModuleManager.descriptions.get(ability));
|
s.sendMessage(Methods.getEarthColor() + AbilityModuleManager.descriptions.get(ability));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else if (Methods.isFireAbility(ability)) {
|
else if (Methods.isFireAbility(ability)) {
|
||||||
s.sendMessage(Methods.getFireColor() + ability + " - ");
|
s.sendMessage(Methods.getFireColor() + ability + " - ");
|
||||||
s.sendMessage(Methods.getFireColor() + AbilityModuleManager.descriptions.get(ability));
|
s.sendMessage(Methods.getFireColor() + AbilityModuleManager.descriptions.get(ability));
|
||||||
|
|
|
@ -44,6 +44,7 @@ public class ConfigManager {
|
||||||
config.addDefault("Properties.Chat.Colors.Air", "GRAY");
|
config.addDefault("Properties.Chat.Colors.Air", "GRAY");
|
||||||
config.addDefault("Properties.Chat.Colors.Water", "AQUA");
|
config.addDefault("Properties.Chat.Colors.Water", "AQUA");
|
||||||
config.addDefault("Properties.Chat.Colors.Earth", "GREEN");
|
config.addDefault("Properties.Chat.Colors.Earth", "GREEN");
|
||||||
|
config.addDefault("Properties.Chat.Colors.Metalbending", "DARK_GREEN");
|
||||||
config.addDefault("Properties.Chat.Colors.Fire", "RED");
|
config.addDefault("Properties.Chat.Colors.Fire", "RED");
|
||||||
config.addDefault("Properties.Chat.Colors.Chi", "GOLD");
|
config.addDefault("Properties.Chat.Colors.Chi", "GOLD");
|
||||||
|
|
||||||
|
|
|
@ -500,6 +500,10 @@ public class Methods {
|
||||||
return ChatColor.valueOf(plugin.getConfig().getString("Properties.Chat.Colors.Earth"));
|
return ChatColor.valueOf(plugin.getConfig().getString("Properties.Chat.Colors.Earth"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static ChatColor getMetalbendingColor() {
|
||||||
|
return ChatColor.valueOf(plugin.getConfig().getString("Properties.Chat.Colors.Metalbending"));
|
||||||
|
}
|
||||||
|
|
||||||
public static ChatColor getFireColor() {
|
public static ChatColor getFireColor() {
|
||||||
return ChatColor.valueOf(plugin.getConfig().getString("Properties.Chat.Colors.Fire"));
|
return ChatColor.valueOf(plugin.getConfig().getString("Properties.Chat.Colors.Fire"));
|
||||||
}
|
}
|
||||||
|
@ -1619,9 +1623,25 @@ public class Methods {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean isMetalBlock(Block block) {
|
||||||
|
if (block.getType() == Material.GOLD_BLOCK
|
||||||
|
|| block.getType() == Material.IRON_BLOCK
|
||||||
|
|| block.getType() == Material.IRON_ORE
|
||||||
|
|| block.getType() == Material.GOLD_ORE
|
||||||
|
|| block.getType() == Material.QUARTZ_BLOCK
|
||||||
|
|| block.getType() == Material.QUARTZ_ORE)
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
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, 32, 37, 38, 39, 40, 59, 81, 83, 86, 99, 100, 103, 104, 105, 106, 111, 161, 175};
|
||||||
public static Integer[] transparentToEarthbending = {0, 6, 8, 9, 10, 11, 30, 31, 32, 37, 38, 39, 40, 50, 51, 59, 78, 83, 106};
|
public static Integer[] transparentToEarthbending = {0, 6, 8, 9, 10, 11, 30, 31, 32, 37, 38, 39, 40, 50, 51, 59, 78, 83, 106};
|
||||||
public static Integer[] nonOpaque = {0, 6, 8, 9, 10, 11, 27, 28, 30, 31, 32, 37, 38, 39, 40, 50, 51, 55, 59, 66, 68, 69, 70, 72,
|
public static Integer[] nonOpaque = {0, 6, 8, 9, 10, 11, 27, 28, 30, 31, 32, 37, 38, 39, 40, 50, 51, 55, 59, 66, 68, 69, 70, 72,
|
||||||
75, 76, 77, 78, 83, 90, 93, 94, 104, 105, 106, 111, 115, 119, 127, 131, 132};
|
75, 76, 77, 78, 83, 90, 93, 94, 104, 105, 106, 111, 115, 119, 127, 131, 132};
|
||||||
|
|
||||||
|
public static boolean isMetalbendingAbility(String ability) {
|
||||||
|
if (AbilityModuleManager.metalbendingabilities.contains(ability)) return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,9 @@ public class EarthPassive {
|
||||||
|
|
||||||
public static boolean softenLanding(Player player) {
|
public static boolean softenLanding(Player player) {
|
||||||
Block block = player.getLocation().getBlock().getRelative(BlockFace.DOWN);
|
Block block = player.getLocation().getBlock().getRelative(BlockFace.DOWN);
|
||||||
|
if (Methods.canMetalbend(player) && Methods.isMetalBlock(block)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
if (Methods.isEarthbendable(player, block) || Methods.isTransparentToEarthbending(player, block)) {
|
if (Methods.isEarthbendable(player, block) || Methods.isTransparentToEarthbending(player, block)) {
|
||||||
if (!Methods.isTransparentToEarthbending(player, block)) {
|
if (!Methods.isTransparentToEarthbending(player, block)) {
|
||||||
Material type = block.getType();
|
Material type = block.getType();
|
||||||
|
|
|
@ -17,6 +17,7 @@ Properties:
|
||||||
Fire: RED
|
Fire: RED
|
||||||
Water: AQUA
|
Water: AQUA
|
||||||
Earth: GREEN
|
Earth: GREEN
|
||||||
|
Metalbending: DARK_GREEN
|
||||||
Chi: GOLD
|
Chi: GOLD
|
||||||
RegionProtection:
|
RegionProtection:
|
||||||
AllowHarmlessAbilities: true
|
AllowHarmlessAbilities: true
|
||||||
|
|
Loading…
Reference in a new issue