From c4ad5ae28eb0dff98162b546556027ff88276ca7 Mon Sep 17 00:00:00 2001 From: alexcrea <42614139+alexcrea@users.noreply.github.com> Date: Tue, 18 Mar 2025 14:38:19 +0100 Subject: [PATCH] fix circular dependency WHY is there no warning when it happens --- .../xyz/alexcrea/cuanvil/util/AnvilUseType.kt | 8 ++++---- .../alexcrea/cuanvil/util/config/LoreEditType.kt | 14 ++++++++++---- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/main/kotlin/xyz/alexcrea/cuanvil/util/AnvilUseType.kt b/src/main/kotlin/xyz/alexcrea/cuanvil/util/AnvilUseType.kt index 2072d56..d17e908 100644 --- a/src/main/kotlin/xyz/alexcrea/cuanvil/util/AnvilUseType.kt +++ b/src/main/kotlin/xyz/alexcrea/cuanvil/util/AnvilUseType.kt @@ -31,22 +31,22 @@ enum class AnvilUseType( "Custom Craft", Material.CRAFTING_TABLE ), LORE_EDIT_BOOK_APPEND( - "lore_edit_book_append", LoreEditType.APPEND_BOOK.rootPath, + "lore_edit_book_append", "lore_edit.book_and_quil.append", WorkPenaltyPart(false, false), "Book Add", Material.WRITABLE_BOOK ), LORE_EDIT_BOOK_REMOVE( - "lore_edit_book_remove", LoreEditType.REMOVE_BOOK.rootPath, + "lore_edit_book_remove", "lore_edit.book_and_quil.remove", WorkPenaltyPart(false, false), "Book Remove", Material.WRITABLE_BOOK ), LORE_EDIT_PAPER_APPEND( - "lore_edit_paper_append", LoreEditType.APPEND_PAPER.rootPath, + "lore_edit_paper_append", "lore_edit.paper.append_line", WorkPenaltyPart(false, false), "Paper Add", Material.WRITABLE_BOOK ), LORE_EDIT_PAPER_REMOVE( - "lore_edit_paper_remove", LoreEditType.REMOVE_PAPER.rootPath, + "lore_edit_paper_remove", "lore_edit.paper.remove_line", WorkPenaltyPart(false, false), "Paper Remove", Material.WRITABLE_BOOK ), diff --git a/src/main/kotlin/xyz/alexcrea/cuanvil/util/config/LoreEditType.kt b/src/main/kotlin/xyz/alexcrea/cuanvil/util/config/LoreEditType.kt index 6079bbe..ed5ef1b 100644 --- a/src/main/kotlin/xyz/alexcrea/cuanvil/util/config/LoreEditType.kt +++ b/src/main/kotlin/xyz/alexcrea/cuanvil/util/config/LoreEditType.kt @@ -21,12 +21,18 @@ enum class LoreEditType( val isAppend: Boolean, val isMultiLine: Boolean, ) { - APPEND_BOOK("lore_edit.book_and_quil.append", AnvilUseType.LORE_EDIT_BOOK_APPEND, true, true), - REMOVE_BOOK("lore_edit.book_and_quil.remove", AnvilUseType.LORE_EDIT_BOOK_REMOVE, false, true), - APPEND_PAPER("lore_edit.paper.append_line", AnvilUseType.LORE_EDIT_PAPER_APPEND, true, false), - REMOVE_PAPER("lore_edit.paper.remove_line", AnvilUseType.LORE_EDIT_PAPER_REMOVE, false, false), + APPEND_BOOK(AnvilUseType.LORE_EDIT_BOOK_APPEND, true, true), + REMOVE_BOOK(AnvilUseType.LORE_EDIT_BOOK_REMOVE, false, true), + APPEND_PAPER(AnvilUseType.LORE_EDIT_PAPER_APPEND, true, false), + REMOVE_PAPER(AnvilUseType.LORE_EDIT_PAPER_REMOVE, false, false), ; + constructor( + useType: AnvilUseType, + isAppend: Boolean, + isMultiLine: Boolean, + ) : this(useType.path, useType, isAppend, isMultiLine) + /** * If this edit type is enabled */