mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-11 20:00:46 +00:00
Also do a nullcheck on enchants
This commit is contained in:
parent
d17bd144a2
commit
6b6cf41782
1 changed files with 13 additions and 7 deletions
|
@ -152,20 +152,26 @@ public class Enchantments {
|
||||||
// 1.8
|
// 1.8
|
||||||
try {
|
try {
|
||||||
Enchantment depthStrider = Enchantment.getByName("DEPTH_STRIDER");
|
Enchantment depthStrider = Enchantment.getByName("DEPTH_STRIDER");
|
||||||
ENCHANTMENTS.put("depthstrider", depthStrider);
|
if (depthStrider != null) {
|
||||||
ALIASENCHANTMENTS.put("depth", depthStrider);
|
ENCHANTMENTS.put("depthstrider", depthStrider);
|
||||||
ALIASENCHANTMENTS.put("strider", depthStrider);
|
ALIASENCHANTMENTS.put("depth", depthStrider);
|
||||||
|
ALIASENCHANTMENTS.put("strider", depthStrider);
|
||||||
|
}
|
||||||
} catch (IllegalArgumentException ignored) {}
|
} catch (IllegalArgumentException ignored) {}
|
||||||
|
|
||||||
// 1.9
|
// 1.9
|
||||||
try {
|
try {
|
||||||
Enchantment frostWalker = Enchantment.getByName("FROST_WALKER");
|
Enchantment frostWalker = Enchantment.getByName("FROST_WALKER");
|
||||||
ENCHANTMENTS.put("frostwalker", frostWalker);
|
if (frostWalker != null) {
|
||||||
ALIASENCHANTMENTS.put("frost", frostWalker);
|
ENCHANTMENTS.put("frostwalker", frostWalker);
|
||||||
ALIASENCHANTMENTS.put("walker", frostWalker);
|
ALIASENCHANTMENTS.put("frost", frostWalker);
|
||||||
|
ALIASENCHANTMENTS.put("walker", frostWalker);
|
||||||
|
}
|
||||||
|
|
||||||
Enchantment mending = Enchantment.getByName("MENDING");
|
Enchantment mending = Enchantment.getByName("MENDING");
|
||||||
ENCHANTMENTS.put("mending", mending);
|
if (mending != null) {
|
||||||
|
ENCHANTMENTS.put("mending", mending);
|
||||||
|
}
|
||||||
} catch (IllegalArgumentException ignored) {}
|
} catch (IllegalArgumentException ignored) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue