mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-11 20:00:46 +00:00
Merge pull request #408 from AdamQpzm/2.x
Add fix for enchants & kits on 1.7
This commit is contained in:
commit
30fce436dd
2 changed files with 12 additions and 4 deletions
|
@ -149,9 +149,11 @@ public class Enchantments {
|
||||||
ENCHANTMENTS.put("lure", Enchantment.LURE);
|
ENCHANTMENTS.put("lure", Enchantment.LURE);
|
||||||
ALIASENCHANTMENTS.put("rodlure", Enchantment.LURE);
|
ALIASENCHANTMENTS.put("rodlure", Enchantment.LURE);
|
||||||
|
|
||||||
ENCHANTMENTS.put("depthstrider", Enchantment.DEPTH_STRIDER);
|
try {
|
||||||
ALIASENCHANTMENTS.put("depth", Enchantment.DEPTH_STRIDER);
|
ENCHANTMENTS.put("depthstrider", Enchantment.getByName("DEPTH_STRIDER"));
|
||||||
ALIASENCHANTMENTS.put("strider", Enchantment.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) {
|
public static Enchantment getByName(String name) {
|
||||||
|
|
|
@ -148,6 +148,12 @@ public class MetaItemStack {
|
||||||
return;
|
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)) {
|
if (split.length > 1 && split[0].equalsIgnoreCase("name") && hasMetaPermission(sender, "name", false, true, ess)) {
|
||||||
final String displayName = FormatUtil.replaceFormat(split[1].replace('_', ' '));
|
final String displayName = FormatUtil.replaceFormat(split[1].replace('_', ' '));
|
||||||
final ItemMeta meta = stack.getItemMeta();
|
final ItemMeta meta = stack.getItemMeta();
|
||||||
|
@ -197,7 +203,7 @@ public class MetaItemStack {
|
||||||
addFireworkMeta(sender, false, string, ess);
|
addFireworkMeta(sender, false, string, ess);
|
||||||
} else if (stack.getType() == Material.POTION) { //WARNING - Meta for potions will be ignored after this point.
|
} else if (stack.getType() == Material.POTION) { //WARNING - Meta for potions will be ignored after this point.
|
||||||
addPotionMeta(sender, false, string, ess);
|
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);
|
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)) {
|
} 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("(\\||,)");
|
final String[] color = split[1].split("(\\||,)");
|
||||||
|
|
Loading…
Reference in a new issue