Split unsafe enchantments in kits to a new config option

This commit is contained in:
snowleo 2014-02-18 23:47:18 +01:00
parent a1a190bb02
commit 3f2c2aadbb
4 changed files with 14 additions and 2 deletions

View file

@ -155,6 +155,8 @@ public interface ISettings extends IConf
boolean getUpdateBedAtDaytime();
boolean allowUnsafeEnchantments();
boolean allowUnsafeEnchantmentsInKits();
boolean getRepairEnchanted();

View file

@ -174,7 +174,7 @@ public class Kit
IText output = new KeywordReplacer(input, user.getSource(), ess);
boolean spew = false;
final boolean allowUnsafe = ess.getSettings().allowUnsafeEnchantments();
final boolean allowUnsafe = ess.getSettings().allowUnsafeEnchantmentsInKits();
for (String kitItem : output.getLines())
{
if (kitItem.startsWith(ess.getSettings().getCurrencySymbol()))

View file

@ -944,6 +944,12 @@ public class Settings implements net.ess3.api.ISettings
return config.getBoolean("repair-enchanted", true);
}
@Override
public boolean allowUnsafeEnchantmentsInKits()
{
return config.getBoolean("unsafe-enchantments-in-kits", config.getBoolean("unsafe-enchantments", false));
}
@Override
public boolean allowUnsafeEnchantments()
{

View file

@ -395,7 +395,11 @@ oversized-stacksize: 64
# essentials.repair.enchanted
repair-enchanted: true
# Allow 'unsafe' enchantments in kits and item spawning.
# Allow 'unsafe' enchantments in kits.
# Warning: Mixing and overleveling some enchantments can cause issues with clients, servers and plugins.
unsafe-enchantments-in-kits: false
# Allow 'unsafe' enchantments in item spawning.
# Warning: Mixing and overleveling some enchantments can cause issues with clients, servers and plugins.
unsafe-enchantments: false