mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-11-18 00:25:32 +01:00
New config options repair-enchanted (default true) and permission essentials.repair.enchanted
This commit is contained in:
parent
1f1b6aff54
commit
1489203aca
@ -138,4 +138,6 @@ public interface ISettings extends IConf
|
||||
Set<String> getNoGodWorlds();
|
||||
|
||||
boolean getUpdateBedAtDaytime();
|
||||
|
||||
boolean getRepairEnchanted();
|
||||
}
|
||||
|
@ -549,4 +549,8 @@ public class Settings implements ISettings
|
||||
{
|
||||
this.debug = debug;
|
||||
}
|
||||
|
||||
public boolean getRepairEnchanted() {
|
||||
return config.getBoolean("repair-enchanted", true);
|
||||
}
|
||||
}
|
||||
|
@ -32,6 +32,14 @@ public class Commandrepair extends EssentialsCommand
|
||||
{
|
||||
throw new Exception(_("repairInvalidType"));
|
||||
}
|
||||
|
||||
if (!item.getEnchantments().isEmpty()
|
||||
&& !ess.getSettings().getRepairEnchanted()
|
||||
&& !user.isAuthorized("essentials.repair.enchanted"))
|
||||
{
|
||||
throw new Exception(_("repairEnchanted"));
|
||||
}
|
||||
|
||||
final String itemName = item.getType().toString().toLowerCase(Locale.ENGLISH);
|
||||
final Trade charge = new Trade("repair-" + itemName.replace('_', '-'), ess);
|
||||
|
||||
@ -104,6 +112,12 @@ public class Commandrepair extends EssentialsCommand
|
||||
user.sendMessage(ex.getMessage());
|
||||
continue;
|
||||
}
|
||||
if (!item.getEnchantments().isEmpty()
|
||||
&& !ess.getSettings().getRepairEnchanted()
|
||||
&& !user.isAuthorized("essentials.repair.enchanted"))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -227,6 +227,11 @@ no-god-in-worlds:
|
||||
# How many items should be in a oversized stack?
|
||||
oversized-stacksize: 64
|
||||
|
||||
# Do you allow to repair enchanted weapons and armor?
|
||||
# If you set this to false, you can still allow it for certain players using the permission
|
||||
# essentials.repair.enchanted
|
||||
repair-enchanted: true
|
||||
|
||||
############################################################
|
||||
# +------------------------------------------------------+ #
|
||||
# | EssentialsHome | #
|
||||
|
Loading…
Reference in New Issue
Block a user