diff --git a/README.md b/README.md index 978ea34..d772c3a 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ the plugin can be downloaded on - Custom enchantment level limit. - Custom anvil recipes. - Custom enchant restrictions (allow unsafe enchantment only for a group of item or create new restriction). -- Custom items of unit repairs (repair damaged with unit of "material", for example the repair of diamond sword by diamonds). +- Custom items of unit repairs (repair damaged with unit of items types, for example the repair of diamond sword by diamonds). - Custom XP cost for every aspect of the anvil. - Permissions to bypass level limit or enchantment restriction. - Display XP cost instead of "too expensive" when above level 40. (see below for more information) diff --git a/src/main/java/xyz/alexcrea/cuanvil/gui/config/SelectItemTypeContainer.java b/src/main/java/xyz/alexcrea/cuanvil/gui/config/SelectItemTypeContainer.java index f490b6c..76c3fdb 100644 --- a/src/main/java/xyz/alexcrea/cuanvil/gui/config/SelectItemTypeContainer.java +++ b/src/main/java/xyz/alexcrea/cuanvil/gui/config/SelectItemTypeContainer.java @@ -18,7 +18,7 @@ public interface SelectItemTypeContainer { Set illegalItems(); static List getItemLore(SelectItemTypeContainer container, String containerType, String action) { - // Prepare material lore + // Prepare item lore ArrayList groupLore = new ArrayList<>(); groupLore.add("§7Allow you to select a list of §eitems §7that this " + containerType + " should " + action); Set typeSet = container.getSelectedItems(); diff --git a/src/main/java/xyz/alexcrea/cuanvil/gui/config/list/UnitRepairElementListGui.java b/src/main/java/xyz/alexcrea/cuanvil/gui/config/list/UnitRepairElementListGui.java index 0066c3d..73a55a6 100644 --- a/src/main/java/xyz/alexcrea/cuanvil/gui/config/list/UnitRepairElementListGui.java +++ b/src/main/java/xyz/alexcrea/cuanvil/gui/config/list/UnitRepairElementListGui.java @@ -81,7 +81,7 @@ public class UnitRepairElementListGui extends return; } - // Add new material + // Add new item ConfigHolder.UNIT_REPAIR_HOLDER.getConfig().set(parentType.getKey() + "." + type.getKey(), 0.25); if (GuiSharedConstant.TEMPORARY_DO_SAVE_TO_DISK_EVERY_CHANGE) { @@ -92,7 +92,7 @@ public class UnitRepairElementListGui extends updateValueForGeneric(type, true); this.parentGui.updateValueForGeneric(this.parentType, true); - // Display material edit setting + // Display item edit setting this.factoryMap.get(type).create().show(player); }, true @@ -108,15 +108,15 @@ public class UnitRepairElementListGui extends @Override protected DoubleSettingGui.DoubleSettingFactory createFactory(ItemType type) { - String materialDisplayName = CasedStringUtil.snakeToUpperSpacedCase(type.getKey().getKey()); + String displayName = CasedStringUtil.snakeToUpperSpacedCase(type.getKey().getKey()); return new DoubleSettingGui.DoubleSettingFactory( - "§0%§8" + materialDisplayName + " Repair", + "§0%§8" + displayName + " Repair", this, ConfigHolder.UNIT_REPAIR_HOLDER, this.parentType.getKey() + "." + type.getKey(), Arrays.asList( - "§7Click here to change how many §e% §7of §a" + materialDisplayName, + "§7Click here to change how many §e% §7of §a" + displayName, "§7Should get repaired by §e" + this.typeName ), 2, diff --git a/src/main/java/xyz/alexcrea/cuanvil/gui/config/list/elements/GroupConfigSubSettingGui.java b/src/main/java/xyz/alexcrea/cuanvil/gui/config/list/elements/GroupConfigSubSettingGui.java index 8501b00..820434f 100644 --- a/src/main/java/xyz/alexcrea/cuanvil/gui/config/list/elements/GroupConfigSubSettingGui.java +++ b/src/main/java/xyz/alexcrea/cuanvil/gui/config/list/elements/GroupConfigSubSettingGui.java @@ -323,7 +323,7 @@ public class GroupConfigSubSettingGui extends MappedToListSubSettingGui implemen // ---------------------------- // End of SelectGroupContainer related methods // ---------------------------- - // SelectMaterialContainer related methods + // SelectItemTypeContainer related methods // ---------------------------- @Override @@ -368,7 +368,7 @@ public class GroupConfigSubSettingGui extends MappedToListSubSettingGui implemen } // ---------------------------- - // End of SelectMaterialContainer related methods + // End of SelectItemTypeContainer related methods // ---------------------------- private void updateDirectReferencingGroups(AbstractItemTypeGroup referenceTo) { diff --git a/src/main/java/xyz/alexcrea/cuanvil/gui/config/settings/DoubleSettingGui.java b/src/main/java/xyz/alexcrea/cuanvil/gui/config/settings/DoubleSettingGui.java index 9a7b980..c8fde69 100644 --- a/src/main/java/xyz/alexcrea/cuanvil/gui/config/settings/DoubleSettingGui.java +++ b/src/main/java/xyz/alexcrea/cuanvil/gui/config/settings/DoubleSettingGui.java @@ -268,7 +268,7 @@ public class DoubleSettingGui extends AbstractSettingGui { protected GuiItem stepGuiItem(int stepIndex) { BigDecimal stepValue = holder.steps[stepIndex]; - // Get material properties + // Get item properties ItemType stepType; StringBuilder stepName = new StringBuilder("§"); List stepLore; diff --git a/src/main/java/xyz/alexcrea/cuanvil/gui/config/settings/IntSettingsGui.java b/src/main/java/xyz/alexcrea/cuanvil/gui/config/settings/IntSettingsGui.java index fdf64e5..5827fbc 100644 --- a/src/main/java/xyz/alexcrea/cuanvil/gui/config/settings/IntSettingsGui.java +++ b/src/main/java/xyz/alexcrea/cuanvil/gui/config/settings/IntSettingsGui.java @@ -218,7 +218,7 @@ public class IntSettingsGui extends AbstractSettingGui { protected GuiItem stepGuiItem(int stepIndex) { int stepValue = holder.steps[stepIndex]; - // Get material properties + // Get item properties ItemType stepMat; StringBuilder stepName = new StringBuilder("§"); List stepLore; diff --git a/src/main/java/xyz/alexcrea/cuanvil/gui/config/settings/ItemTypeSelectSettingGui.java b/src/main/java/xyz/alexcrea/cuanvil/gui/config/settings/ItemTypeSelectSettingGui.java index 032d456..d08c4bf 100644 --- a/src/main/java/xyz/alexcrea/cuanvil/gui/config/settings/ItemTypeSelectSettingGui.java +++ b/src/main/java/xyz/alexcrea/cuanvil/gui/config/settings/ItemTypeSelectSettingGui.java @@ -29,10 +29,10 @@ public class ItemTypeSelectSettingGui extends MappedElementListConfigGui defaultMaterials; - private final Set illegalMaterials; - private final int defaultMaterialHash; - private int nowMaterialHash; + private final List defaultItems; + private final Set illegalItems; + private final int defaultItemHash; + private int nowItemHash; public ItemTypeSelectSettingGui( @NotNull SelectItemTypeContainer selector, @@ -43,11 +43,11 @@ public class ItemTypeSelectSettingGui extends MappedElementListConfigGui(this.selector.getSelectedItems()); - this.illegalMaterials = this.selector.illegalItems(); + this.defaultItems = new ArrayList<>(this.selector.getSelectedItems()); + this.illegalItems = this.selector.illegalItems(); - this.defaultMaterialHash = hashFromItemTypeList(this.defaultMaterials); - this.nowMaterialHash = this.defaultMaterialHash; + this.defaultItemHash = hashFromItemTypeList(this.defaultItems); + this.nowItemHash = this.defaultItemHash; init(); @@ -185,15 +185,15 @@ public class ItemTypeSelectSettingGui extends MappedElementListConfigGui getEveryDisplayableInstanceOfGeneric() { - return this.defaultMaterials; + return this.defaultItems; } @Override @@ -232,12 +232,12 @@ public class ItemTypeSelectSettingGui extends MappedElementListConfigGui { removeItemType(type); @@ -253,7 +253,7 @@ public class ItemTypeSelectSettingGui extends MappedElementListConfigGui itemTypeList) { - int defaultMaterialHash = 0; + int hash = 0; for (ItemType type : itemTypeList) { - defaultMaterialHash ^= type.hashCode(); //TODO check would this be valid with item type + hash ^= type.hashCode(); //TODO check would this be valid with item type } - return defaultMaterialHash; + return hash; } private void setSaveItem() { @@ -287,7 +287,7 @@ public class ItemTypeSelectSettingGui extends MappedElementListConfigGui) { + private fun writeItemRestriction(esEnchantments: List) { for (enchantment in esEnchantments) { val conflict = ConflictBuilder("restriction_${enchantment.key.key}", CustomAnvil.instance) conflict.addEnchantment(enchantment)