mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-11-27 01:40:48 +08:00
Merge pull request #408 from AdamQpzm/2.x
Add fix for enchants & kits on 1.7
This commit is contained in:
commit
30fce436dd
@ -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) {
|
||||
|
@ -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("(\\||,)");
|
||||
|
Loading…
Reference in New Issue
Block a user