Metalbendable Blocks

This commit is contained in:
MistPhizzle 2014-10-05 18:18:55 -04:00
parent 599fe06320
commit 789a5b9911
3 changed files with 19 additions and 0 deletions

View file

@ -32,6 +32,11 @@ public class ConfigManager {
earthbendable.add("SAND");
earthbendable.add("SANDSTONE");
earthbendable.add("MYCEL");
ArrayList<String> metals = new ArrayList<String>();
metals.add("IRON_BLOCK");
metals.add("GOLD_BLOCK");
metals.add("QUARTZ_BLOCK");
config.addDefault("Properties.Chat.Enable", true);
config.addDefault("Properties.Chat.Format", "<name>: <message>");
@ -84,6 +89,7 @@ public class ConfigManager {
config.addDefault("Properties.Earth.RevertCheckTime", 300000);
config.addDefault("Properties.Earth.CanBendWithWeapons", true);
config.addDefault("Properties.Earth.EarthbendableBlocks", earthbendable);
config.addDefault("Properties.Earth.MetalBlocks", metals);
config.addDefault("Properties.Fire.CanBendWithWeapons", true);
config.addDefault("Properties.Fire.DayFactor", 1.5);

View file

@ -1083,6 +1083,11 @@ public class Methods {
public static boolean isEarthbendable(Player player, Block block) {
return isEarthbendable(player, "RaiseEarth", block);
}
public static boolean isMetal(Block block) {
Material material = block.getType();
return ProjectKorra.plugin.getConfig().getStringList("Properties.Earth.MetalBlocks").contains(material.toString());
}
public static boolean isEarthbendable(Player player, String ability, Block block)
{
@ -1093,6 +1098,10 @@ public class Methods {
valid = true;
break;
}
if (isMetal(block) && canMetalbend(player)) {
valid = true;
}
if(!valid)
return false;

View file

@ -61,6 +61,10 @@ Properties:
- SAND
- SANDSTONE
- MYCEL
MetalBlocks:
- IRON_BLOCK
- GOLD_BLOCK
- QUARTZ_BLOCK
Fire:
CanBendWithWeapons: true
DayFactor: 1.5