Add fix for enchants & kits on 1.7

This commit is contained in:
AdamQpzm 2016-02-06 11:24:36 +00:00
parent ba5ce33464
commit dfdc6a52be
2 changed files with 12 additions and 4 deletions

View File

@ -149,9 +149,11 @@ public class Enchantments {
ENCHANTMENTS.put("lure", Enchantment.LURE);
ALIASENCHANTMENTS.put("rodlure", Enchantment.LURE);
ENCHANTMENTS.put("depthstrider", Enchantment.DEPTH_STRIDER);
ALIASENCHANTMENTS.put("depth", Enchantment.DEPTH_STRIDER);
ALIASENCHANTMENTS.put("strider", Enchantment.DEPTH_STRIDER);
try {
ENCHANTMENTS.put("depthstrider", Enchantment.getByName("DEPTH_STRIDER"));
ALIASENCHANTMENTS.put("depth", Enchantment.getByName("DEPTH_STRIDER"));
ALIASENCHANTMENTS.put("strider", Enchantment.getByName("DEPTH_STRIDER"));
} catch(IllegalArgumentException ignored) {}
}
public static Enchantment getByName(String name) {

View File

@ -148,6 +148,12 @@ public class MetaItemStack {
return;
}
Material banner = null;
try {
banner = Material.valueOf("BANNER");
} catch(IllegalArgumentException ignored){}
if (split.length > 1 && split[0].equalsIgnoreCase("name") && hasMetaPermission(sender, "name", false, true, ess)) {
final String displayName = FormatUtil.replaceFormat(split[1].replace('_', ' '));
final ItemMeta meta = stack.getItemMeta();
@ -197,7 +203,7 @@ public class MetaItemStack {
addFireworkMeta(sender, false, string, ess);
} else if (stack.getType() == Material.POTION) { //WARNING - Meta for potions will be ignored after this point.
addPotionMeta(sender, false, string, ess);
} else if (stack.getType() == Material.BANNER) { //WARNING - Meta for banners will be ignored after this point.
} else if (banner != null && stack.getType() == banner) { //WARNING - Meta for banners will be ignored after this point.
addBannerMeta(sender, false, string, ess);
} else if (split.length > 1 && (split[0].equalsIgnoreCase("color") || split[0].equalsIgnoreCase("colour")) && (stack.getType() == Material.LEATHER_BOOTS || stack.getType() == Material.LEATHER_CHESTPLATE || stack.getType() == Material.LEATHER_HELMET || stack.getType() == Material.LEATHER_LEGGINGS)) {
final String[] color = split[1].split("(\\||,)");