mirror of
https://github.com/essentials/Essentials.git
synced 2025-08-20 13:31:25 +02:00
[Fix] Move allowunsafe enchant perm to: essentials.enchantments.allowunsafe
This commit is contained in:
@@ -36,7 +36,7 @@ public class Commandenchant extends EssentialsCommand
|
|||||||
for (Map.Entry<String, Enchantment> entry : Enchantments.entrySet())
|
for (Map.Entry<String, Enchantment> entry : Enchantments.entrySet())
|
||||||
{
|
{
|
||||||
final String enchantmentName = entry.getValue().getName().toLowerCase(Locale.ENGLISH);
|
final String enchantmentName = entry.getValue().getName().toLowerCase(Locale.ENGLISH);
|
||||||
if (enchantmentslist.contains(enchantmentName) || (user.isAuthorized("essentials.enchant." + enchantmentName) && entry.getValue().canEnchantItem(stack)))
|
if (enchantmentslist.contains(enchantmentName) || (user.isAuthorized("essentials.enchantments." + enchantmentName) && entry.getValue().canEnchantItem(stack)))
|
||||||
{
|
{
|
||||||
enchantmentslist.add(entry.getKey());
|
enchantmentslist.add(entry.getKey());
|
||||||
//enchantmentslist.add(enchantmentName);
|
//enchantmentslist.add(enchantmentName);
|
||||||
@@ -58,7 +58,7 @@ public class Commandenchant extends EssentialsCommand
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
final boolean allowUnsafe = ess.getSettings().allowUnsafeEnchantments() && user.isAuthorized("essentials.enchant.allowunsafe");
|
final boolean allowUnsafe = ess.getSettings().allowUnsafeEnchantments() && user.isAuthorized("essentials.enchantments.allowunsafe");
|
||||||
|
|
||||||
final MetaItemStack metaStack = new MetaItemStack(stack);
|
final MetaItemStack metaStack = new MetaItemStack(stack);
|
||||||
final Enchantment enchantment = metaStack.getEnchantment(user, args[0]);
|
final Enchantment enchantment = metaStack.getEnchantment(user, args[0]);
|
||||||
|
@@ -73,7 +73,7 @@ public class Commandgive extends EssentialsCommand
|
|||||||
{
|
{
|
||||||
MetaItemStack metaStack = new MetaItemStack(stack);
|
MetaItemStack metaStack = new MetaItemStack(stack);
|
||||||
boolean allowUnsafe = ess.getSettings().allowUnsafeEnchantments();
|
boolean allowUnsafe = ess.getSettings().allowUnsafeEnchantments();
|
||||||
if (allowUnsafe && sender instanceof Player && !ess.getUser(sender).isAuthorized("essentials.enchant.allowunsafe"))
|
if (allowUnsafe && sender instanceof Player && !ess.getUser(sender).isAuthorized("essentials.enchantments.allowunsafe"))
|
||||||
{
|
{
|
||||||
allowUnsafe = false;
|
allowUnsafe = false;
|
||||||
}
|
}
|
||||||
|
@@ -58,7 +58,7 @@ public class Commanditem extends EssentialsCommand
|
|||||||
if (args.length > 2)
|
if (args.length > 2)
|
||||||
{
|
{
|
||||||
MetaItemStack metaStack = new MetaItemStack(stack);
|
MetaItemStack metaStack = new MetaItemStack(stack);
|
||||||
final boolean allowUnsafe = ess.getSettings().allowUnsafeEnchantments() && user.isAuthorized("essentials.enchant.allowunsafe");
|
final boolean allowUnsafe = ess.getSettings().allowUnsafeEnchantments() && user.isAuthorized("essentials.enchantments.allowunsafe");
|
||||||
|
|
||||||
metaStack.parseStringMeta(user, allowUnsafe, args, 2, ess);
|
metaStack.parseStringMeta(user, allowUnsafe, args, 2, ess);
|
||||||
|
|
||||||
|
@@ -49,7 +49,7 @@ public class SignEnchant extends EssentialsSign
|
|||||||
sign.setLine(2, "§c<enchant>");
|
sign.setLine(2, "§c<enchant>");
|
||||||
throw new SignException(ex.getMessage(), ex);
|
throw new SignException(ex.getMessage(), ex);
|
||||||
}
|
}
|
||||||
final boolean allowUnsafe = ess.getSettings().allowUnsafeEnchantments() && player.isAuthorized("essentials.enchant.allowunsafe");
|
final boolean allowUnsafe = ess.getSettings().allowUnsafeEnchantments() && player.isAuthorized("essentials.enchantments.allowunsafe");
|
||||||
if (level < 0 || (!allowUnsafe && level > enchantment.getMaxLevel()))
|
if (level < 0 || (!allowUnsafe && level > enchantment.getMaxLevel()))
|
||||||
{
|
{
|
||||||
level = enchantment.getMaxLevel();
|
level = enchantment.getMaxLevel();
|
||||||
|
Reference in New Issue
Block a user