mirror of
https://github.com/alexcrea/CustomAnvil.git
synced 2026-06-23 16:16:17 +02:00
remove per line cost on single line use type
This commit is contained in:
parent
2f30e19573
commit
20d8fb6eda
2 changed files with 9 additions and 5 deletions
|
|
@ -36,7 +36,9 @@ public class PluginSetDefault {
|
|||
|
||||
nbSet+= trySetDefault(config, path + IS_ENABLED, DEFAULT_IS_ENABLED);
|
||||
nbSet+= trySetDefault(config, path + FIXED_COST, DEFAULT_FIXED_COST);
|
||||
nbSet+= trySetDefault(config, path + PER_LINE_COST, DEFAULT_PER_LINE_COST);
|
||||
if(value.isMultiLine()){
|
||||
nbSet+= trySetDefault(config, path + PER_LINE_COST, DEFAULT_PER_LINE_COST);
|
||||
}
|
||||
if(value.isAppend()){
|
||||
nbSet+= trySetDefault(config, path + DO_CONSUME, DEFAULT_DO_CONSUME);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,11 +7,12 @@ enum class LoreEditType(
|
|||
val rootPath: String,
|
||||
val useType: AnvilUseType,
|
||||
val isAppend: Boolean,
|
||||
val isMultiLine: Boolean,
|
||||
) {
|
||||
APPEND_BOOK("lore_edit.book_and_quil.append", AnvilUseType.LORE_EDIT_BOOK_APPEND, true),
|
||||
REMOVE_BOOK("lore_edit.book_and_quil.remove", AnvilUseType.LORE_EDIT_BOOK_REMOVE,false),
|
||||
APPEND_PAPER("lore_edit.paper.append", AnvilUseType.LORE_EDIT_PAPER_APPEND,true),
|
||||
REMOVE_PAPER("lore_edit.paper.remove", AnvilUseType.LORE_EDIT_PAPER_REMOVE,false),
|
||||
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", AnvilUseType.LORE_EDIT_PAPER_APPEND,true, false),
|
||||
REMOVE_PAPER("lore_edit.paper.remove", AnvilUseType.LORE_EDIT_PAPER_REMOVE,false, false),
|
||||
;
|
||||
|
||||
/**
|
||||
|
|
@ -41,6 +42,7 @@ enum class LoreEditType(
|
|||
*/
|
||||
val perLineCost: Int
|
||||
get() {
|
||||
if (!isMultiLine) throw IllegalStateException("Per line cost get on single line edit type")
|
||||
return CONFIG
|
||||
.config
|
||||
.getInt("${rootPath}.${LoreEditConfigUtil.PER_LINE_COST}", LoreEditConfigUtil.DEFAULT_PER_LINE_COST)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue