mirror of
https://github.com/alexcrea/CustomAnvil.git
synced 2026-06-23 16:16:17 +02:00
add/change item of basic config menu.
This commit is contained in:
parent
065a3a13d8
commit
321a2b1cc8
5 changed files with 165 additions and 46 deletions
|
|
@ -9,8 +9,11 @@ import org.bukkit.Material;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.inventory.meta.ItemMeta;
|
import org.bukkit.inventory.meta.ItemMeta;
|
||||||
import xyz.alexcrea.cuanvil.gui.config.BasicConfigGui;
|
import xyz.alexcrea.cuanvil.gui.config.BasicConfigGui;
|
||||||
|
import xyz.alexcrea.cuanvil.gui.utils.GuiGlobalActions;
|
||||||
import xyz.alexcrea.cuanvil.gui.utils.GuiGlobalItems;
|
import xyz.alexcrea.cuanvil.gui.utils.GuiGlobalItems;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
|
||||||
public class MainConfigGui extends ChestGui {
|
public class MainConfigGui extends ChestGui {
|
||||||
|
|
||||||
public final static MainConfigGui INSTANCE = new MainConfigGui();
|
public final static MainConfigGui INSTANCE = new MainConfigGui();
|
||||||
|
|
@ -19,14 +22,14 @@ public class MainConfigGui extends ChestGui {
|
||||||
INSTANCE.init();
|
INSTANCE.init();
|
||||||
}
|
}
|
||||||
private MainConfigGui() {
|
private MainConfigGui() {
|
||||||
super(3, "\u00A7cAnvil Config", CustomAnvil.instance);
|
super(3, "\u00A78Anvil Config", CustomAnvil.instance);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void init(){
|
private void init(){
|
||||||
Pattern pattern = new Pattern(
|
Pattern pattern = new Pattern(
|
||||||
"000000000",
|
"000000000",
|
||||||
"001234500",
|
"012304560",
|
||||||
"Q00000000"
|
"Q00000000"
|
||||||
);
|
);
|
||||||
PatternPane pane = new PatternPane(0, 0, 9, 3, pattern);
|
PatternPane pane = new PatternPane(0, 0, 9, 3, pattern);
|
||||||
|
|
@ -34,20 +37,35 @@ public class MainConfigGui extends ChestGui {
|
||||||
|
|
||||||
GuiGlobalItems.addBackgroundItem(pane);
|
GuiGlobalItems.addBackgroundItem(pane);
|
||||||
|
|
||||||
|
// Basic config item
|
||||||
|
ItemStack basicConfigItemstack = new ItemStack(Material.COMMAND_BLOCK);
|
||||||
|
ItemMeta basicConfigMeta = basicConfigItemstack.getItemMeta();
|
||||||
|
|
||||||
ItemStack stonePlaceholder = new ItemStack(Material.STONE);
|
basicConfigMeta.setDisplayName("\u00A7aBasic Config Menu");
|
||||||
GuiItem placeholder1 = GuiGlobalItems.toGuiItem(stonePlaceholder, BasicConfigGui.INSTANCE);
|
basicConfigMeta.setLore(Collections.singletonList("\u00A77Click here to open basic config menu"));
|
||||||
GuiItem placeholder2 = new GuiItem(stonePlaceholder,CustomAnvil.instance);
|
basicConfigItemstack.setItemMeta(basicConfigMeta);
|
||||||
GuiItem placeholder3 = new GuiItem(stonePlaceholder,CustomAnvil.instance);
|
|
||||||
GuiItem placeholder4 = new GuiItem(stonePlaceholder,CustomAnvil.instance);
|
|
||||||
GuiItem placeholder5 = new GuiItem(stonePlaceholder,CustomAnvil.instance);
|
|
||||||
|
|
||||||
|
|
||||||
|
GuiItem placeholder1 = GuiGlobalItems.goToGuiItem(basicConfigItemstack, BasicConfigGui.INSTANCE);
|
||||||
pane.bindItem('1', placeholder1);
|
pane.bindItem('1', placeholder1);
|
||||||
pane.bindItem('2', placeholder2);
|
|
||||||
pane.bindItem('3', placeholder3);
|
// WIP configuration items
|
||||||
pane.bindItem('4', placeholder4);
|
ItemStack wipItemstack = new ItemStack(Material.BARRIER);
|
||||||
pane.bindItem('5', placeholder5);
|
ItemMeta wipMeta = wipItemstack.getItemMeta();
|
||||||
|
wipMeta.setDisplayName("\u00A7cWIP");
|
||||||
|
wipItemstack.setItemMeta(wipMeta);
|
||||||
|
|
||||||
|
GuiItem wip2 = new GuiItem(wipItemstack, GuiGlobalActions.stayInPlace, CustomAnvil.instance);
|
||||||
|
GuiItem wip3 = new GuiItem(wipItemstack, GuiGlobalActions.stayInPlace, CustomAnvil.instance);
|
||||||
|
GuiItem wip4 = new GuiItem(wipItemstack, GuiGlobalActions.stayInPlace, CustomAnvil.instance);
|
||||||
|
GuiItem wip5 = new GuiItem(wipItemstack, GuiGlobalActions.stayInPlace, CustomAnvil.instance);
|
||||||
|
GuiItem wip6 = new GuiItem(wipItemstack, GuiGlobalActions.stayInPlace, CustomAnvil.instance);
|
||||||
|
|
||||||
|
|
||||||
|
pane.bindItem('2', wip2);
|
||||||
|
pane.bindItem('3', wip3);
|
||||||
|
pane.bindItem('4', wip4);
|
||||||
|
pane.bindItem('5', wip5);
|
||||||
|
pane.bindItem('6', wip6);
|
||||||
|
|
||||||
// quit item
|
// quit item
|
||||||
ItemStack quitItemstack = new ItemStack(Material.BARRIER);
|
ItemStack quitItemstack = new ItemStack(Material.BARRIER);
|
||||||
|
|
|
||||||
|
|
@ -4,14 +4,21 @@ import com.github.stefvanschie.inventoryframework.gui.GuiItem;
|
||||||
import com.github.stefvanschie.inventoryframework.pane.PatternPane;
|
import com.github.stefvanschie.inventoryframework.pane.PatternPane;
|
||||||
import com.github.stefvanschie.inventoryframework.pane.util.Pattern;
|
import com.github.stefvanschie.inventoryframework.pane.util.Pattern;
|
||||||
import io.delilaheve.CustomAnvil;
|
import io.delilaheve.CustomAnvil;
|
||||||
|
import io.delilaheve.util.ConfigOptions;
|
||||||
|
import kotlin.ranges.IntRange;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
import org.bukkit.inventory.meta.ItemMeta;
|
||||||
import xyz.alexcrea.cuanvil.config.ConfigHolder;
|
import xyz.alexcrea.cuanvil.config.ConfigHolder;
|
||||||
import xyz.alexcrea.cuanvil.gui.MainConfigGui;
|
import xyz.alexcrea.cuanvil.gui.MainConfigGui;
|
||||||
import xyz.alexcrea.cuanvil.gui.ValueUpdatableGui;
|
import xyz.alexcrea.cuanvil.gui.ValueUpdatableGui;
|
||||||
import xyz.alexcrea.cuanvil.gui.config.settings.BoolSettingsGui;
|
import xyz.alexcrea.cuanvil.gui.config.settings.BoolSettingsGui;
|
||||||
import xyz.alexcrea.cuanvil.gui.config.settings.IntSettingsGui;
|
import xyz.alexcrea.cuanvil.gui.config.settings.IntSettingsGui;
|
||||||
|
import xyz.alexcrea.cuanvil.gui.utils.GuiGlobalActions;
|
||||||
import xyz.alexcrea.cuanvil.gui.utils.GuiGlobalItems;
|
import xyz.alexcrea.cuanvil.gui.utils.GuiGlobalItems;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
|
||||||
public class BasicConfigGui extends ValueUpdatableGui {
|
public class BasicConfigGui extends ValueUpdatableGui {
|
||||||
|
|
||||||
public final static BasicConfigGui INSTANCE = new BasicConfigGui();
|
public final static BasicConfigGui INSTANCE = new BasicConfigGui();
|
||||||
|
|
@ -21,7 +28,7 @@ public class BasicConfigGui extends ValueUpdatableGui {
|
||||||
}
|
}
|
||||||
|
|
||||||
private BasicConfigGui(){
|
private BasicConfigGui(){
|
||||||
super(3, "\u00A7cBasic Config GUI", CustomAnvil.instance);
|
super(3, "\u00A78Basic Config GUI", CustomAnvil.instance);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -29,7 +36,7 @@ public class BasicConfigGui extends ValueUpdatableGui {
|
||||||
private void init(){
|
private void init(){
|
||||||
Pattern pattern = new Pattern(
|
Pattern pattern = new Pattern(
|
||||||
"000000000",
|
"000000000",
|
||||||
"012000000",
|
"012345670",
|
||||||
"B00000000"
|
"B00000000"
|
||||||
);
|
);
|
||||||
pane = new PatternPane(0, 0, 9, 3, pattern);
|
pane = new PatternPane(0, 0, 9, 3, pattern);
|
||||||
|
|
@ -38,19 +45,108 @@ public class BasicConfigGui extends ValueUpdatableGui {
|
||||||
GuiGlobalItems.addBackItem(pane, MainConfigGui.INSTANCE);
|
GuiGlobalItems.addBackItem(pane, MainConfigGui.INSTANCE);
|
||||||
GuiGlobalItems.addBackgroundItem(pane);
|
GuiGlobalItems.addBackgroundItem(pane);
|
||||||
|
|
||||||
|
prepareValues();
|
||||||
updateGuiValues();
|
updateGuiValues();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private BoolSettingsGui.BoolSettingFactory limitRepairFactory;
|
||||||
|
private IntSettingsGui.IntSettingFactory repairCostFactory;
|
||||||
|
private GuiItem notNeededLimitValueItem;
|
||||||
|
private BoolSettingsGui.BoolSettingFactory removeRepairLimit;
|
||||||
|
private IntSettingsGui.IntSettingFactory itemRepairCost;
|
||||||
|
private IntSettingsGui.IntSettingFactory unitRepairCost;
|
||||||
|
private IntSettingsGui.IntSettingFactory itemRenameCost;
|
||||||
|
private IntSettingsGui.IntSettingFactory sacrificeIllegalEnchantCost;
|
||||||
|
|
||||||
|
protected void prepareValues(){
|
||||||
|
// limit repair item
|
||||||
|
this.limitRepairFactory = BoolSettingsGui.factory("\u00A78Limit Repair Cost ?",this,
|
||||||
|
ConfigOptions.LIMIT_REPAIR_COST, ConfigHolder.DEFAULT_CONFIG, ConfigOptions.DEFAULT_LIMIT_REPAIR);
|
||||||
|
|
||||||
|
// rename cost item
|
||||||
|
IntRange range = ConfigOptions.REPAIR_LIMIT_RANGE;
|
||||||
|
this.repairCostFactory = IntSettingsGui.factory("\u00A78Repair Cost Limit", this,
|
||||||
|
ConfigOptions.LIMIT_REPAIR_VALUE, ConfigHolder.DEFAULT_CONFIG, range.getFirst(),range.getLast(),
|
||||||
|
ConfigOptions.DEFAULT_LIMIT_REPAIR_VALUE,
|
||||||
|
1, 5, 10, 50, 100);
|
||||||
|
|
||||||
|
// rename cost not needed
|
||||||
|
ItemStack item = new ItemStack(Material.BARRIER);
|
||||||
|
ItemMeta meta = item.getItemMeta();
|
||||||
|
|
||||||
|
meta.setDisplayName("\u00A7cRepair Cost Limit");
|
||||||
|
meta.setLore(Collections.singletonList("\u00A77Please, enable repair cost limit for this variable to be editable."));
|
||||||
|
item.setItemMeta(meta);
|
||||||
|
this.notNeededLimitValueItem = new GuiItem(item, GuiGlobalActions.stayInPlace, CustomAnvil.instance);
|
||||||
|
|
||||||
|
// remove repair limit item
|
||||||
|
this.removeRepairLimit = BoolSettingsGui.factory("\u00A78Remove Repair Limit ?",this,
|
||||||
|
ConfigOptions.REMOVE_REPAIR_LIMIT, ConfigHolder.DEFAULT_CONFIG, ConfigOptions.DEFAULT_REMOVE_LIMIT);
|
||||||
|
|
||||||
|
// item repair cost
|
||||||
|
range = ConfigOptions.REPAIR_COST_RANGE;
|
||||||
|
this.itemRepairCost = IntSettingsGui.factory("\u00A78Item repair cost", this,
|
||||||
|
ConfigOptions.ITEM_REPAIR_COST, ConfigHolder.DEFAULT_CONFIG, range.getFirst(),range.getLast(),
|
||||||
|
ConfigOptions.DEFAULT_ITEM_REPAIR_COST,
|
||||||
|
1, 5, 10);
|
||||||
|
|
||||||
|
// unit repair cost
|
||||||
|
this.unitRepairCost = IntSettingsGui.factory("\u00A78Unit repair cost", this,
|
||||||
|
ConfigOptions.UNIT_REPAIR_COST, ConfigHolder.DEFAULT_CONFIG, range.getFirst(),range.getLast(),
|
||||||
|
ConfigOptions.DEFAULT_UNIT_REPAIR_COST,
|
||||||
|
1, 5, 10, 50, 100);
|
||||||
|
|
||||||
|
// item rename cost
|
||||||
|
range = ConfigOptions.ITEM_RENAME_COST_RANGE;
|
||||||
|
this.itemRenameCost = IntSettingsGui.factory("\u00A78Rename Cost", this,
|
||||||
|
ConfigOptions.ITEM_RENAME_COST, ConfigHolder.DEFAULT_CONFIG, range.getFirst(),range.getLast(),
|
||||||
|
ConfigOptions.DEFAULT_ITEM_RENAME_COST,
|
||||||
|
1, 5, 10, 50, 100);
|
||||||
|
|
||||||
|
// sacrifice illegal enchant cost
|
||||||
|
range = ConfigOptions.SACRIFICE_ILLEGAL_COST_RANGE;
|
||||||
|
this.sacrificeIllegalEnchantCost = IntSettingsGui.factory("\u00A78Sacrifice Illegal enchant Cost", this,
|
||||||
|
ConfigOptions.SACRIFICE_ILLEGAL_COST, ConfigHolder.DEFAULT_CONFIG, range.getFirst(),range.getLast(),
|
||||||
|
ConfigOptions.DEFAULT_SACRIFICE_ILLEGAL_COST,
|
||||||
|
1, 5, 10, 50, 100);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateGuiValues() {
|
public void updateGuiValues() {
|
||||||
// Update item with value
|
// limit repair item
|
||||||
IntSettingsGui.IntSettingFactory factory1 = IntSettingsGui.factory( "Test GUI", this, "test", ConfigHolder.DEFAULT_CONFIG, 0,255,2,1, 5, 10, 50, 100);
|
GuiItem limitRepairItem = GuiGlobalItems.boolSettingGuiItem(this.limitRepairFactory);
|
||||||
GuiItem setting1 = GuiGlobalItems.intSettingGuiItem(factory1, Material.COMMAND_BLOCK);
|
pane.bindItem('1', limitRepairItem);
|
||||||
pane.bindItem('1', setting1);
|
|
||||||
|
|
||||||
BoolSettingsGui.BoolSettingFactory factory2 = BoolSettingsGui.factory("Test Gui bool",this, "test2", ConfigHolder.DEFAULT_CONFIG, false);
|
// rename cost item
|
||||||
GuiItem setting2 = GuiGlobalItems.boolSettingGuiItem(factory2);
|
GuiItem limitRepairValueItem;
|
||||||
pane.bindItem('2', setting2);
|
if(this.limitRepairFactory.getConfiguredValue()){
|
||||||
|
limitRepairValueItem = GuiGlobalItems.intSettingGuiItem(this.repairCostFactory, Material.EXPERIENCE_BOTTLE);
|
||||||
|
}else{
|
||||||
|
limitRepairValueItem = this.notNeededLimitValueItem;
|
||||||
|
}
|
||||||
|
pane.bindItem('2', limitRepairValueItem);
|
||||||
|
|
||||||
|
// remove repair limit item
|
||||||
|
GuiItem removeRepairLimitItem = GuiGlobalItems.boolSettingGuiItem(this.removeRepairLimit);
|
||||||
|
pane.bindItem('3', removeRepairLimitItem);
|
||||||
|
|
||||||
|
// item repair cost
|
||||||
|
GuiItem itemRepairCostItem = GuiGlobalItems.intSettingGuiItem(this.itemRepairCost, Material.ANVIL);
|
||||||
|
pane.bindItem('4', itemRepairCostItem);
|
||||||
|
|
||||||
|
// unit repair cost
|
||||||
|
GuiItem unitRepairCostItem = GuiGlobalItems.intSettingGuiItem(this.unitRepairCost, Material.DIAMOND);
|
||||||
|
pane.bindItem('5', unitRepairCostItem);
|
||||||
|
|
||||||
|
// item rename cost
|
||||||
|
GuiItem itemRenameCost = GuiGlobalItems.intSettingGuiItem(this.itemRenameCost, Material.NAME_TAG);
|
||||||
|
pane.bindItem('6', itemRenameCost);
|
||||||
|
|
||||||
|
// sacrifice illegal enchant cost
|
||||||
|
GuiItem illegalCostItem = GuiGlobalItems.intSettingGuiItem(this.sacrificeIllegalEnchantCost, Material.ENCHANTED_BOOK);
|
||||||
|
pane.bindItem('7', illegalCostItem);
|
||||||
|
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ import java.util.Collections;
|
||||||
public class GuiGlobalItems {
|
public class GuiGlobalItems {
|
||||||
|
|
||||||
// return
|
// return
|
||||||
public static GuiItem toGuiItem(@NotNull ItemStack item, @NotNull Gui goal){
|
public static GuiItem goToGuiItem(@NotNull ItemStack item, @NotNull Gui goal){
|
||||||
return new GuiItem(item, GuiGlobalActions.openGuiAction(goal), CustomAnvil.instance);
|
return new GuiItem(item, GuiGlobalActions.openGuiAction(goal), CustomAnvil.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -33,7 +33,7 @@ public class GuiGlobalItems {
|
||||||
}
|
}
|
||||||
public static GuiItem backItem(@NotNull Gui goal){
|
public static GuiItem backItem(@NotNull Gui goal){
|
||||||
// simple go back item
|
// simple go back item
|
||||||
return toGuiItem(BACK_ITEM, goal);
|
return goToGuiItem(BACK_ITEM, goal);
|
||||||
}
|
}
|
||||||
public static void addBackItem(@NotNull PatternPane target,
|
public static void addBackItem(@NotNull PatternPane target,
|
||||||
@NotNull Gui goal){
|
@NotNull Gui goal){
|
||||||
|
|
|
||||||
|
|
@ -13,19 +13,19 @@ object ConfigOptions {
|
||||||
// Path for default enchantment limits
|
// Path for default enchantment limits
|
||||||
private const val DEFAULT_LIMIT_PATH = "default_limit"
|
private const val DEFAULT_LIMIT_PATH = "default_limit"
|
||||||
// Path for limiting repair cost
|
// Path for limiting repair cost
|
||||||
private const val LIMIT_REPAIR_COST = "limit_repair_cost"
|
const val LIMIT_REPAIR_COST = "limit_repair_cost"
|
||||||
// Path for repair value limit
|
// Path for repair value limit
|
||||||
private const val LIMIT_REPAIR_VALUE = "limit_repair_value"
|
const val LIMIT_REPAIR_VALUE = "limit_repair_value"
|
||||||
// Path for level cost on item repair
|
// Path for level cost on item repair
|
||||||
private const val ITEM_REPAIR_COST = "item_repair_cost"
|
const val ITEM_REPAIR_COST = "item_repair_cost"
|
||||||
// Path for level cost on unit repair
|
// Path for level cost on unit repair
|
||||||
private const val UNIT_REPAIR_COST = "unit_repair_cost"
|
const val UNIT_REPAIR_COST = "unit_repair_cost"
|
||||||
// Path for level cost on item renaming
|
// Path for level cost on item renaming
|
||||||
private const val ITEM_RENAME_COST = "item_rename_cost"
|
const val ITEM_RENAME_COST = "item_rename_cost"
|
||||||
// Path for level cost on illegal enchantment on sacrifice
|
// Path for level cost on illegal enchantment on sacrifice
|
||||||
private const val SACRIFICE_ILLEGAL_COST = "sacrifice_illegal_enchant_cost"
|
const val SACRIFICE_ILLEGAL_COST = "sacrifice_illegal_enchant_cost"
|
||||||
// Path for removing repair cost limits
|
// Path for removing repair cost limits
|
||||||
private const val REMOVE_REPAIR_LIMIT = "remove_repair_limit"
|
const val REMOVE_REPAIR_LIMIT = "remove_repair_limit"
|
||||||
// Root path for enchantment limits
|
// Root path for enchantment limits
|
||||||
const val ENCHANT_LIMIT_ROOT = "enchant_limits"
|
const val ENCHANT_LIMIT_ROOT = "enchant_limits"
|
||||||
// Root path for enchantment values
|
// Root path for enchantment values
|
||||||
|
|
@ -39,29 +39,34 @@ object ConfigOptions {
|
||||||
// Default value for enchantment limits
|
// Default value for enchantment limits
|
||||||
private const val DEFAULT_ENCHANT_LIMIT = 5
|
private const val DEFAULT_ENCHANT_LIMIT = 5
|
||||||
// Default value for limiting repair cost
|
// Default value for limiting repair cost
|
||||||
private const val DEFAULT_LIMIT_REPAIR = true
|
const val DEFAULT_LIMIT_REPAIR = true
|
||||||
// Default value for repair cost limit
|
// Default value for repair cost limit
|
||||||
private const val DEFAULT_LIMIT_REPAIR_VALUE = 39
|
const val DEFAULT_LIMIT_REPAIR_VALUE = 39
|
||||||
// Default value for level cost on item repair
|
// Default value for level cost on item repair
|
||||||
private const val DEFAULT_ITEM_REPAIR_COST = 2
|
const val DEFAULT_ITEM_REPAIR_COST = 2
|
||||||
// Default value for level cost per unit repair
|
// Default value for level cost per unit repair
|
||||||
private const val DEFAULT_UNIT_REPAIR_COST = 1
|
const val DEFAULT_UNIT_REPAIR_COST = 1
|
||||||
// Default value for level cost on item renaming
|
// Default value for level cost on item renaming
|
||||||
private const val DEFAULT_ITEM_RENAME_COST = 1
|
const val DEFAULT_ITEM_RENAME_COST = 1
|
||||||
// Default value for level cost on illegal enchantment on sacrifice
|
// Default value for level cost on illegal enchantment on sacrifice
|
||||||
private const val DEFAULT_SACRIFICE_ILLEGAL_COST = 1
|
const val DEFAULT_SACRIFICE_ILLEGAL_COST = 1
|
||||||
// Valid range for repair cost limit
|
// Valid range for repair cost limit
|
||||||
private val REPAIR_LIMIT_RANGE = 1..39
|
@JvmField
|
||||||
|
val REPAIR_LIMIT_RANGE = 1..39
|
||||||
// Valid range for repair cost
|
// Valid range for repair cost
|
||||||
private val REPAIR_COST_RANGE = 0..255
|
@JvmField
|
||||||
|
val REPAIR_COST_RANGE = 0..255
|
||||||
// Valid range for rename cost
|
// Valid range for rename cost
|
||||||
private val ITEM_RENAME_COST_RANGE = 0..255
|
@JvmField
|
||||||
|
val ITEM_RENAME_COST_RANGE = 0..255
|
||||||
// Valid range for illegal enchantment conflict cost
|
// Valid range for illegal enchantment conflict cost
|
||||||
private val SACRIFICE_ILLEGAL_COST_RANGE = 0..255
|
@JvmField
|
||||||
|
val SACRIFICE_ILLEGAL_COST_RANGE = 0..255
|
||||||
// Default for removing repair cost limits
|
// Default for removing repair cost limits
|
||||||
private const val DEFAULT_REMOVE_LIMIT = false
|
const val DEFAULT_REMOVE_LIMIT = false
|
||||||
// Valid range for an enchantment limit
|
// Valid range for an enchantment limit
|
||||||
private val ENCHANT_LIMIT_RANGE = 1..255
|
@JvmField
|
||||||
|
val ENCHANT_LIMIT_RANGE = 1..255
|
||||||
// Default value for an enchantment multiplier
|
// Default value for an enchantment multiplier
|
||||||
private const val DEFAULT_ENCHANT_VALUE = 0
|
private const val DEFAULT_ENCHANT_VALUE = 0
|
||||||
// Default value for debug logging
|
// Default value for debug logging
|
||||||
|
|
|
||||||
|
|
@ -32,11 +32,11 @@ class ReloadExecutor : CommandExecutor {
|
||||||
*/
|
*/
|
||||||
private fun commandBody(hardfail: Boolean): Boolean{
|
private fun commandBody(hardfail: Boolean): Boolean{
|
||||||
try {
|
try {
|
||||||
if(!ConfigHolder.reloadAllFromDisk(hardfail)) return false;
|
if(!ConfigHolder.reloadAllFromDisk(hardfail)) return false
|
||||||
|
|
||||||
// Then update all global gui containing value from config
|
// Then update all global gui containing value from config
|
||||||
BasicConfigGui.INSTANCE.updateGuiValues();
|
BasicConfigGui.INSTANCE.updateGuiValues()
|
||||||
return true;
|
return true
|
||||||
}catch (e: Exception){
|
}catch (e: Exception){
|
||||||
e.printStackTrace()
|
e.printStackTrace()
|
||||||
return false
|
return false
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue