mirror of
https://github.com/alexcrea/CustomAnvil.git
synced 2026-06-24 00:26:16 +02:00
2 minor fix
fix work penalty type setting gui not saving on the right path fix anvil use type not using correct path for paper
This commit is contained in:
parent
87dd099fca
commit
d61ef6c0d6
2 changed files with 6 additions and 6 deletions
|
|
@ -219,12 +219,11 @@ public class WorkPenaltyTypeSettingGui extends AbstractSettingGui {
|
|||
}
|
||||
|
||||
public static boolean saveWorkPenalty(Map<AnvilUseType, WorkPenaltyType.WorkPenaltyPart> partEnum) {
|
||||
String path = ConfigOptions.WORK_PENALTY_ROOT;
|
||||
ConfigHolder configHolder = ConfigHolder.DEFAULT_CONFIG;
|
||||
FileConfiguration config = configHolder.getConfig();
|
||||
|
||||
partEnum.forEach((key, value) -> {
|
||||
String partPath = path + "." + key.getTypeName();
|
||||
String partPath = key.getPath();
|
||||
|
||||
if (key.getDefaultPenalty().equals(value)) {
|
||||
config.set(partPath, null);
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package xyz.alexcrea.cuanvil.util
|
|||
|
||||
import org.bukkit.Material
|
||||
import xyz.alexcrea.cuanvil.config.WorkPenaltyType.WorkPenaltyPart
|
||||
import xyz.alexcrea.cuanvil.util.config.LoreEditType
|
||||
|
||||
enum class AnvilUseType(
|
||||
val typeName: String, val path: String,
|
||||
|
|
@ -30,22 +31,22 @@ enum class AnvilUseType(
|
|||
"Custom Craft", Material.CRAFTING_TABLE
|
||||
),
|
||||
LORE_EDIT_BOOK_APPEND(
|
||||
"lore_edit_book_append", "lore_edit.book_and_quil.append",
|
||||
"lore_edit_book_append", LoreEditType.APPEND_BOOK.rootPath,
|
||||
WorkPenaltyPart(false, false),
|
||||
"Book Add", Material.WRITABLE_BOOK
|
||||
),
|
||||
LORE_EDIT_BOOK_REMOVE(
|
||||
"lore_edit_book_remove", "lore_edit.book_and_quil.remove",
|
||||
"lore_edit_book_remove", LoreEditType.REMOVE_BOOK.rootPath,
|
||||
WorkPenaltyPart(false, false),
|
||||
"Book Remove", Material.WRITABLE_BOOK
|
||||
),
|
||||
LORE_EDIT_PAPER_APPEND(
|
||||
"lore_edit_paper_append", "lore_edit.paper.append",
|
||||
"lore_edit_paper_append", LoreEditType.APPEND_PAPER.rootPath,
|
||||
WorkPenaltyPart(false, false),
|
||||
"Paper Add", Material.WRITABLE_BOOK
|
||||
),
|
||||
LORE_EDIT_PAPER_REMOVE(
|
||||
"lore_edit_paper_remove", "lore_edit.paper.remove",
|
||||
"lore_edit_paper_remove", LoreEditType.REMOVE_PAPER.rootPath,
|
||||
WorkPenaltyPart(false, false),
|
||||
"Paper Remove", Material.WRITABLE_BOOK
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue