mirror of
https://github.com/alexcrea/CustomAnvil.git
synced 2026-06-23 16:16:17 +02:00
Moved some and added more config
This commit is contained in:
parent
78e4ffd0c6
commit
3f15143c2b
9 changed files with 519 additions and 156 deletions
|
|
@ -273,18 +273,78 @@ disable-merge-over:
|
||||||
# Settings for lore modification
|
# Settings for lore modification
|
||||||
lore_edit:
|
lore_edit:
|
||||||
book_and_quil:
|
book_and_quil:
|
||||||
|
# Permission is ca.lore_edit.book
|
||||||
use_permission: true
|
use_permission: true
|
||||||
# permission is ca.lore_edit.book
|
append:
|
||||||
append: false
|
# If adding lore using book & quil is enabled
|
||||||
remove: false
|
enabled: false
|
||||||
|
# Cost used every time
|
||||||
|
fixed_cost: 1
|
||||||
|
# Cost used for every lore line added
|
||||||
|
per_line_cost: 0
|
||||||
|
# Use left item cost penalty if any
|
||||||
|
use_cost_penalty: false
|
||||||
|
# Increase left item cost penalty
|
||||||
|
increase_cost_penalty: false
|
||||||
|
# If adding the lore consume the book & quil
|
||||||
|
do_consume: false
|
||||||
|
|
||||||
|
remove:
|
||||||
|
# If removing lore using book & quil is enabled
|
||||||
|
enabled: false
|
||||||
|
# Cost used every time
|
||||||
|
fixed_cost: 1
|
||||||
|
# Cost used for every lore line removed
|
||||||
|
per_line_cost: 0
|
||||||
|
# Use left item cost penalty if any
|
||||||
|
use_cost_penalty: false
|
||||||
|
# Increase left item cost penalty
|
||||||
|
increase_cost_penalty: false
|
||||||
|
|
||||||
|
# Allow using color code and hexadecimal color when editing lore via book & quil
|
||||||
|
#
|
||||||
|
# Color code are prefixed by "&" and hexadecimal color by "#"
|
||||||
|
# Color code will not be applied if it colors nothing. "&&" can be used to write "&"
|
||||||
|
color:
|
||||||
|
allow_color_code: false
|
||||||
|
allow_hexadecimal_color: false
|
||||||
|
|
||||||
paper:
|
paper:
|
||||||
|
# Permission is ca.lore_edit.paper
|
||||||
use_permission: true
|
use_permission: true
|
||||||
# permission is ca.lore_edit.paper
|
|
||||||
append_line: false
|
|
||||||
remove_line: false
|
|
||||||
# what order should the lines should get added/removed (start/end, if invalid or not present will be end)
|
# what order should the lines should get added/removed (start/end, if invalid or not present will be end)
|
||||||
order: "end"
|
order: "end"
|
||||||
|
|
||||||
|
append_line:
|
||||||
|
# If adding lore line using paper is enabled
|
||||||
|
enabled: false
|
||||||
|
# Cost used every time
|
||||||
|
fixed_cost: 1
|
||||||
|
# Use left item cost penalty if any
|
||||||
|
use_cost_penalty: false
|
||||||
|
# Increase left item cost penalty
|
||||||
|
increase_cost_penalty: false
|
||||||
|
# If adding the lore line consume the paper
|
||||||
|
do_consume: false
|
||||||
|
|
||||||
|
remove_line:
|
||||||
|
# If removing lore line using paper is enabled
|
||||||
|
enabled: false
|
||||||
|
# Cost used every time
|
||||||
|
fixed_cost: 1
|
||||||
|
# Use left item cost penalty if any
|
||||||
|
use_cost_penalty: false
|
||||||
|
# Increase left item cost penalty
|
||||||
|
increase_cost_penalty: false
|
||||||
|
|
||||||
|
# Allow using color code and hexadecimal color when editing lore via book & quil
|
||||||
|
#
|
||||||
|
# Color code are prefixed by "&" and hexadecimal color by "#"
|
||||||
|
# Color code will not be applied if it colors nothing. "&&" can be used to write "&"
|
||||||
|
color:
|
||||||
|
allow_color_code: false
|
||||||
|
allow_hexadecimal_color: false
|
||||||
|
|
||||||
# Whether to show debug logging
|
# Whether to show debug logging
|
||||||
debug_log: false
|
debug_log: false
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -273,18 +273,78 @@ disable-merge-over:
|
||||||
# Settings for lore modification
|
# Settings for lore modification
|
||||||
lore_edit:
|
lore_edit:
|
||||||
book_and_quil:
|
book_and_quil:
|
||||||
|
# Permission is ca.lore_edit.book
|
||||||
use_permission: true
|
use_permission: true
|
||||||
# permission is ca.lore_edit.book
|
append:
|
||||||
append: false
|
# If adding lore using book & quil is enabled
|
||||||
remove: false
|
enabled: false
|
||||||
|
# Cost used every time
|
||||||
|
fixed_cost: 1
|
||||||
|
# Cost used for every lore line added
|
||||||
|
per_line_cost: 0
|
||||||
|
# Use left item cost penalty if any
|
||||||
|
use_cost_penalty: false
|
||||||
|
# Increase left item cost penalty
|
||||||
|
increase_cost_penalty: false
|
||||||
|
# If adding the lore consume the book & quil
|
||||||
|
do_consume: false
|
||||||
|
|
||||||
|
remove:
|
||||||
|
# If removing lore using book & quil is enabled
|
||||||
|
enabled: false
|
||||||
|
# Cost used every time
|
||||||
|
fixed_cost: 1
|
||||||
|
# Cost used for every lore line removed
|
||||||
|
per_line_cost: 0
|
||||||
|
# Use left item cost penalty if any
|
||||||
|
use_cost_penalty: false
|
||||||
|
# Increase left item cost penalty
|
||||||
|
increase_cost_penalty: false
|
||||||
|
|
||||||
|
# Allow using color code and hexadecimal color when editing lore via book & quil
|
||||||
|
#
|
||||||
|
# Color code are prefixed by "&" and hexadecimal color by "#"
|
||||||
|
# Color code will not be applied if it colors nothing. "&&" can be used to write "&"
|
||||||
|
color:
|
||||||
|
allow_color_code: false
|
||||||
|
allow_hexadecimal_color: false
|
||||||
|
|
||||||
paper:
|
paper:
|
||||||
|
# Permission is ca.lore_edit.paper
|
||||||
use_permission: true
|
use_permission: true
|
||||||
# permission is ca.lore_edit.paper
|
|
||||||
append_line: false
|
|
||||||
remove_line: false
|
|
||||||
# what order should the lines should get added/removed (start/end, if invalid or not present will be end)
|
# what order should the lines should get added/removed (start/end, if invalid or not present will be end)
|
||||||
order: "end"
|
order: "end"
|
||||||
|
|
||||||
|
append_line:
|
||||||
|
# If adding lore line using paper is enabled
|
||||||
|
enabled: false
|
||||||
|
# Cost used every time
|
||||||
|
fixed_cost: 1
|
||||||
|
# Use left item cost penalty if any
|
||||||
|
use_cost_penalty: false
|
||||||
|
# Increase left item cost penalty
|
||||||
|
increase_cost_penalty: false
|
||||||
|
# If adding the lore line consume the paper
|
||||||
|
do_consume: false
|
||||||
|
|
||||||
|
remove_line:
|
||||||
|
# If removing lore line using paper is enabled
|
||||||
|
enabled: false
|
||||||
|
# Cost used every time
|
||||||
|
fixed_cost: 1
|
||||||
|
# Use left item cost penalty if any
|
||||||
|
use_cost_penalty: false
|
||||||
|
# Increase left item cost penalty
|
||||||
|
increase_cost_penalty: false
|
||||||
|
|
||||||
|
# Allow using color code and hexadecimal color when editing lore via book & quil
|
||||||
|
#
|
||||||
|
# Color code are prefixed by "&" and hexadecimal color by "#"
|
||||||
|
# Color code will not be applied if it colors nothing. "&&" can be used to write "&"
|
||||||
|
color:
|
||||||
|
allow_color_code: false
|
||||||
|
allow_hexadecimal_color: false
|
||||||
|
|
||||||
# Whether to show debug logging
|
# Whether to show debug logging
|
||||||
debug_log: false
|
debug_log: false
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import org.jetbrains.annotations.NotNull;
|
||||||
import xyz.alexcrea.cuanvil.config.ConfigHolder;
|
import xyz.alexcrea.cuanvil.config.ConfigHolder;
|
||||||
|
|
||||||
import static io.delilaheve.util.ConfigOptions.*;
|
import static io.delilaheve.util.ConfigOptions.*;
|
||||||
|
import static xyz.alexcrea.cuanvil.util.config.LoreEditConfigUtil.*;
|
||||||
|
|
||||||
public class PluginSetDefault {
|
public class PluginSetDefault {
|
||||||
|
|
||||||
|
|
@ -28,7 +29,8 @@ public class PluginSetDefault {
|
||||||
nbSet+= trySetDefault(config, USE_OF_COLOR_COST, DEFAULT_USE_OF_COLOR_COST);
|
nbSet+= trySetDefault(config, USE_OF_COLOR_COST, DEFAULT_USE_OF_COLOR_COST);
|
||||||
nbSet+= trySetDefault(config, DEFAULT_LIMIT_PATH, DEFAULT_ENCHANT_LIMIT);
|
nbSet+= trySetDefault(config, DEFAULT_LIMIT_PATH, DEFAULT_ENCHANT_LIMIT);
|
||||||
|
|
||||||
nbSet+= trySetDefault(config, APPEND_LORE_BOOK_AND_QUIL, DEFAULT_APPEND_LORE_BOOK_AND_QUIL);
|
// TODO rework lore edit defaults
|
||||||
|
/*nbSet+= trySetDefault(config, APPEND_LORE_BOOK_AND_QUIL, DEFAULT_APPEND_LORE_BOOK_AND_QUIL);
|
||||||
nbSet+= trySetDefault(config, APPEND_LORE_LINE_PAPER, DEFAULT_APPEND_LORE_LINE_PAPER);
|
nbSet+= trySetDefault(config, APPEND_LORE_LINE_PAPER, DEFAULT_APPEND_LORE_LINE_PAPER);
|
||||||
|
|
||||||
nbSet+= trySetDefault(config, REMOVE_LORE_BOOK_AND_QUIL, DEFAULT_REMOVE_LORE_BOOK_AND_QUIL);
|
nbSet+= trySetDefault(config, REMOVE_LORE_BOOK_AND_QUIL, DEFAULT_REMOVE_LORE_BOOK_AND_QUIL);
|
||||||
|
|
@ -36,7 +38,7 @@ public class PluginSetDefault {
|
||||||
nbSet+= trySetDefault(config, LORE_LINE_WITH_PAPER_ORDER, DEFAULT_LORE_LINE_WITH_PAPER_ORDER);
|
nbSet+= trySetDefault(config, LORE_LINE_WITH_PAPER_ORDER, DEFAULT_LORE_LINE_WITH_PAPER_ORDER);
|
||||||
|
|
||||||
nbSet+= trySetDefault(config, EDIT_LORE_WITH_BOOK_NEED_PERMISSION, DEFAULT_EDIT_LORE_WITH_BOOK_NEED_PERMISSION);
|
nbSet+= trySetDefault(config, EDIT_LORE_WITH_BOOK_NEED_PERMISSION, DEFAULT_EDIT_LORE_WITH_BOOK_NEED_PERMISSION);
|
||||||
nbSet+= trySetDefault(config, EDIT_LORE_WITH_PAPER_NEED_PERMISSION, DEFAULT_EDIT_LORE_WITH_PAPER_NEED_PERMISSION);
|
nbSet+= trySetDefault(config, EDIT_LORE_WITH_PAPER_NEED_PERMISSION, DEFAULT_EDIT_LORE_WITH_PAPER_NEED_PERMISSION);*/
|
||||||
|
|
||||||
if(nbSet > 0){
|
if(nbSet > 0){
|
||||||
CustomAnvil.instance.getLogger().info("Adding " + nbSet + " absent default config values.");
|
CustomAnvil.instance.getLogger().info("Adding " + nbSet + " absent default config values.");
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ import xyz.alexcrea.cuanvil.config.WorkPenaltyType
|
||||||
import xyz.alexcrea.cuanvil.config.WorkPenaltyType.WorkPenaltyPart
|
import xyz.alexcrea.cuanvil.config.WorkPenaltyType.WorkPenaltyPart
|
||||||
import xyz.alexcrea.cuanvil.enchant.CAEnchantment
|
import xyz.alexcrea.cuanvil.enchant.CAEnchantment
|
||||||
import xyz.alexcrea.cuanvil.util.AnvilUseType
|
import xyz.alexcrea.cuanvil.util.AnvilUseType
|
||||||
import java.util.EnumMap
|
import java.util.*
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Config option accessors
|
* Config option accessors
|
||||||
|
|
@ -51,17 +51,6 @@ object ConfigOptions {
|
||||||
|
|
||||||
const val DISABLE_MERGE_OVER_ROOT = "disable-merge-over"
|
const val DISABLE_MERGE_OVER_ROOT = "disable-merge-over"
|
||||||
|
|
||||||
// Lore edit configs
|
|
||||||
const val APPEND_LORE_BOOK_AND_QUIL = "lore_edit.book_and_quil.append"
|
|
||||||
const val REMOVE_LORE_BOOK_AND_QUIL = "lore_edit.book_and_quil.remove"
|
|
||||||
|
|
||||||
const val APPEND_LORE_LINE_PAPER = "lore_edit.paper.append_line"
|
|
||||||
const val REMOVE_LORE_LINE_PAPER = "lore_edit.paper.remove_line"
|
|
||||||
const val LORE_LINE_WITH_PAPER_ORDER = "lore_edit.paper.order"
|
|
||||||
|
|
||||||
const val EDIT_LORE_WITH_BOOK_NEED_PERMISSION = "lore_edit.book_and_quil.use_permission"
|
|
||||||
const val EDIT_LORE_WITH_PAPER_NEED_PERMISSION = "lore_edit.paper.use_permission"
|
|
||||||
|
|
||||||
// Keys for specific enchantment values
|
// Keys for specific enchantment values
|
||||||
private const val KEY_BOOK = "book"
|
private const val KEY_BOOK = "book"
|
||||||
private const val KEY_ITEM = "item"
|
private const val KEY_ITEM = "item"
|
||||||
|
|
@ -95,17 +84,6 @@ object ConfigOptions {
|
||||||
|
|
||||||
const val DEFAULT_ENCHANT_LIMIT = 5
|
const val DEFAULT_ENCHANT_LIMIT = 5
|
||||||
|
|
||||||
// lore edit config
|
|
||||||
const val DEFAULT_APPEND_LORE_BOOK_AND_QUIL = false
|
|
||||||
const val DEFAULT_REMOVE_LORE_BOOK_AND_QUIL = false
|
|
||||||
|
|
||||||
const val DEFAULT_APPEND_LORE_LINE_PAPER = false
|
|
||||||
const val DEFAULT_REMOVE_LORE_LINE_PAPER = false
|
|
||||||
const val DEFAULT_LORE_LINE_WITH_PAPER_ORDER = "end"
|
|
||||||
|
|
||||||
const val DEFAULT_EDIT_LORE_WITH_BOOK_NEED_PERMISSION = true
|
|
||||||
const val DEFAULT_EDIT_LORE_WITH_PAPER_NEED_PERMISSION = true
|
|
||||||
|
|
||||||
// Debug flag
|
// Debug flag
|
||||||
private const val DEFAULT_DEBUG_LOG = false
|
private const val DEFAULT_DEBUG_LOG = false
|
||||||
private const val DEFAULT_VERBOSE_DEBUG_LOG = false
|
private const val DEFAULT_VERBOSE_DEBUG_LOG = false
|
||||||
|
|
@ -138,6 +116,9 @@ object ConfigOptions {
|
||||||
@JvmField
|
@JvmField
|
||||||
val ENCHANT_LIMIT_RANGE = 1..255
|
val ENCHANT_LIMIT_RANGE = 1..255
|
||||||
|
|
||||||
|
// --------------
|
||||||
|
// Other defaults
|
||||||
|
// --------------
|
||||||
|
|
||||||
// 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
|
||||||
|
|
@ -262,7 +243,10 @@ object ConfigOptions {
|
||||||
/**
|
/**
|
||||||
* If one of the color component is enabled
|
* If one of the color component is enabled
|
||||||
*/
|
*/
|
||||||
val renameColorPossible: Boolean get() { return allowColorCode || allowHexadecimalColor }
|
val renameColorPossible: Boolean
|
||||||
|
get() {
|
||||||
|
return allowColorCode || allowHexadecimalColor
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If players need a permission to use color
|
* If players need a permission to use color
|
||||||
|
|
@ -313,8 +297,10 @@ object ConfigOptions {
|
||||||
|
|
||||||
val penaltyIncrease = section.getBoolean(WORK_PENALTY_INCREASE, defaultPenalty.penaltyIncrease)
|
val penaltyIncrease = section.getBoolean(WORK_PENALTY_INCREASE, defaultPenalty.penaltyIncrease)
|
||||||
val penaltyAdditive = section.getBoolean(WORK_PENALTY_ADDITIVE, defaultPenalty.penaltyAdditive)
|
val penaltyAdditive = section.getBoolean(WORK_PENALTY_ADDITIVE, defaultPenalty.penaltyAdditive)
|
||||||
val exclusivePenaltyIncrease = section.getBoolean(EXCLUSIVE_WORK_PENALTY_INCREASE, defaultPenalty.exclusivePenaltyIncrease)
|
val exclusivePenaltyIncrease =
|
||||||
val exclusivePenaltyAdditive = section.getBoolean(EXCLUSIVE_WORK_PENALTY_ADDITIVE, defaultPenalty.exclusivePenaltyAdditive)
|
section.getBoolean(EXCLUSIVE_WORK_PENALTY_INCREASE, defaultPenalty.exclusivePenaltyIncrease)
|
||||||
|
val exclusivePenaltyAdditive =
|
||||||
|
section.getBoolean(EXCLUSIVE_WORK_PENALTY_ADDITIVE, defaultPenalty.exclusivePenaltyAdditive)
|
||||||
|
|
||||||
return WorkPenaltyPart(penaltyIncrease, penaltyAdditive, exclusivePenaltyIncrease, exclusivePenaltyAdditive)
|
return WorkPenaltyPart(penaltyIncrease, penaltyAdditive, exclusivePenaltyIncrease, exclusivePenaltyAdditive)
|
||||||
}
|
}
|
||||||
|
|
@ -380,7 +366,8 @@ object ConfigOptions {
|
||||||
/**
|
/**
|
||||||
* Get default value if enchantment do not exist on config
|
* Get default value if enchantment do not exist on config
|
||||||
*/
|
*/
|
||||||
private fun getDefaultLevel(enchantmentName: String, // compatibility with 1.20.5. TODO better update system
|
private fun getDefaultLevel(
|
||||||
|
enchantmentName: String, // compatibility with 1.20.5. TODO better update system
|
||||||
): Int {
|
): Int {
|
||||||
if (enchantmentName == "sweeping_edge") {
|
if (enchantmentName == "sweeping_edge") {
|
||||||
val limit = enchantLimit("sweeping")
|
val limit = enchantLimit("sweeping")
|
||||||
|
|
@ -430,8 +417,10 @@ object ConfigOptions {
|
||||||
/**
|
/**
|
||||||
* Get default value if enchantment do not exist on config
|
* Get default value if enchantment do not exist on config
|
||||||
*/
|
*/
|
||||||
private fun getDefaultValue(enchantment: CAEnchantment, // compatibility with 1.20.5. TODO better update system
|
private fun getDefaultValue(
|
||||||
isFromBook: Boolean) : Int {
|
enchantment: CAEnchantment, // compatibility with 1.20.5. TODO better update system
|
||||||
|
isFromBook: Boolean
|
||||||
|
): Int {
|
||||||
|
|
||||||
val enchantmentName = enchantment.key.toString()
|
val enchantmentName = enchantment.key.toString()
|
||||||
if (enchantmentName == "minecraft:sweeping_edge") {
|
if (enchantmentName == "minecraft:sweeping_edge") {
|
||||||
|
|
@ -490,80 +479,4 @@ object ConfigOptions {
|
||||||
.takeIf { it in ENCHANT_LIMIT_RANGE }
|
.takeIf { it in ENCHANT_LIMIT_RANGE }
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------
|
|
||||||
// Lore edits
|
|
||||||
// ----------
|
|
||||||
|
|
||||||
/**
|
|
||||||
* If we should allow appending lore via book and quil
|
|
||||||
*/
|
|
||||||
val appendLoreBookAndQuil: Boolean
|
|
||||||
get() {
|
|
||||||
return ConfigHolder.DEFAULT_CONFIG
|
|
||||||
.config
|
|
||||||
.getBoolean(APPEND_LORE_BOOK_AND_QUIL, DEFAULT_APPEND_LORE_BOOK_AND_QUIL)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* If we should allow appending lore line via paper
|
|
||||||
*/
|
|
||||||
val appendLoreLinePaper: Boolean
|
|
||||||
get() {
|
|
||||||
return ConfigHolder.DEFAULT_CONFIG
|
|
||||||
.config
|
|
||||||
.getBoolean(APPEND_LORE_LINE_PAPER, DEFAULT_APPEND_LORE_LINE_PAPER)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* If we should allow removing lore via book and quil
|
|
||||||
*/
|
|
||||||
val removeLoreBookAndQuil: Boolean
|
|
||||||
get() {
|
|
||||||
return ConfigHolder.DEFAULT_CONFIG
|
|
||||||
.config
|
|
||||||
.getBoolean(APPEND_LORE_BOOK_AND_QUIL, DEFAULT_APPEND_LORE_BOOK_AND_QUIL)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* If we should allow removing lore line via paper
|
|
||||||
*/
|
|
||||||
val removeLoreLinePaper: Boolean
|
|
||||||
get() {
|
|
||||||
return ConfigHolder.DEFAULT_CONFIG
|
|
||||||
.config
|
|
||||||
.getBoolean(APPEND_LORE_LINE_PAPER, DEFAULT_APPEND_LORE_LINE_PAPER)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get if we should append/remove at the end or at the start of the lore list
|
|
||||||
* This may change to an "OrderType" enum or equivalent later
|
|
||||||
*/
|
|
||||||
val paperLoreOrderIsEnd: Boolean
|
|
||||||
get() {
|
|
||||||
return ConfigHolder.DEFAULT_CONFIG
|
|
||||||
.config
|
|
||||||
.getString(LORE_LINE_WITH_PAPER_ORDER, DEFAULT_LORE_LINE_WITH_PAPER_ORDER)
|
|
||||||
.equals(DEFAULT_LORE_LINE_WITH_PAPER_ORDER, ignoreCase = true)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* If lore edit via book need permission
|
|
||||||
*/
|
|
||||||
val BookLoreEditNeedPermission: Boolean
|
|
||||||
get() {
|
|
||||||
return ConfigHolder.DEFAULT_CONFIG
|
|
||||||
.config
|
|
||||||
.getBoolean(EDIT_LORE_WITH_BOOK_NEED_PERMISSION, DEFAULT_EDIT_LORE_WITH_BOOK_NEED_PERMISSION)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* If lore edit via paper need permission
|
|
||||||
*/
|
|
||||||
val PaperLoreEditNeedPermission: Boolean
|
|
||||||
get() {
|
|
||||||
return ConfigHolder.DEFAULT_CONFIG
|
|
||||||
.config
|
|
||||||
.getBoolean(EDIT_LORE_WITH_PAPER_NEED_PERMISSION, DEFAULT_EDIT_LORE_WITH_PAPER_NEED_PERMISSION)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ import xyz.alexcrea.cuanvil.util.AnvilUseType
|
||||||
import xyz.alexcrea.cuanvil.util.AnvilXpUtil
|
import xyz.alexcrea.cuanvil.util.AnvilXpUtil
|
||||||
import xyz.alexcrea.cuanvil.util.CustomRecipeUtil
|
import xyz.alexcrea.cuanvil.util.CustomRecipeUtil
|
||||||
import xyz.alexcrea.cuanvil.util.UnitRepairUtil.getRepair
|
import xyz.alexcrea.cuanvil.util.UnitRepairUtil.getRepair
|
||||||
|
import xyz.alexcrea.cuanvil.util.config.LoreEditConfigUtil
|
||||||
import java.util.*
|
import java.util.*
|
||||||
import kotlin.math.min
|
import kotlin.math.min
|
||||||
|
|
||||||
|
|
@ -411,7 +412,7 @@ class AnvilResultListener : Listener {
|
||||||
val lore = leftMeta.lore!!
|
val lore = leftMeta.lore!!
|
||||||
if (lore.isEmpty()) return false
|
if (lore.isEmpty()) return false
|
||||||
|
|
||||||
val removeEnd = ConfigOptions.paperLoreOrderIsEnd
|
val removeEnd = LoreEditConfigUtil.paperLoreOrderIsEnd
|
||||||
//TODO check & do color
|
//TODO check & do color
|
||||||
val line = if (removeEnd) lore[lore.size - 1]
|
val line = if (removeEnd) lore[lore.size - 1]
|
||||||
else lore[0]
|
else lore[0]
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,11 @@
|
||||||
package xyz.alexcrea.cuanvil.util
|
package xyz.alexcrea.cuanvil.util
|
||||||
|
|
||||||
import io.delilaheve.util.ConfigOptions
|
|
||||||
import org.bukkit.entity.HumanEntity
|
import org.bukkit.entity.HumanEntity
|
||||||
import org.bukkit.inventory.ItemStack
|
import org.bukkit.inventory.ItemStack
|
||||||
import org.bukkit.inventory.meta.BookMeta
|
import org.bukkit.inventory.meta.BookMeta
|
||||||
import org.bukkit.permissions.Permissible
|
import org.bukkit.permissions.Permissible
|
||||||
|
import xyz.alexcrea.cuanvil.util.config.LoreEditConfigUtil
|
||||||
|
import xyz.alexcrea.cuanvil.util.config.LoreEditType
|
||||||
|
|
||||||
object AnvilLoreEditUtil {
|
object AnvilLoreEditUtil {
|
||||||
|
|
||||||
|
|
@ -12,11 +13,11 @@ object AnvilLoreEditUtil {
|
||||||
private const val LORE_BY_PAPER: String = "ca.lore_edit.paper"
|
private const val LORE_BY_PAPER: String = "ca.lore_edit.paper"
|
||||||
|
|
||||||
private fun hasLoreEditByBookPermission(player: Permissible): Boolean {
|
private fun hasLoreEditByBookPermission(player: Permissible): Boolean {
|
||||||
return ConfigOptions.BookLoreEditNeedPermission && player.hasPermission(LORE_BY_BOOK)
|
return LoreEditConfigUtil.bookLoreEditNeedPermission && player.hasPermission(LORE_BY_BOOK)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun hasLoreEditByPaperPermission(player: Permissible): Boolean {
|
private fun hasLoreEditByPaperPermission(player: Permissible): Boolean {
|
||||||
return ConfigOptions.PaperLoreEditNeedPermission && player.hasPermission(LORE_BY_PAPER)
|
return LoreEditConfigUtil.paperLoreEditNeedPermission && player.hasPermission(LORE_BY_PAPER)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun handleLoreAppendByBook(player: Permissible, first: ItemStack, book: BookMeta): ItemStack? {
|
fun handleLoreAppendByBook(player: Permissible, first: ItemStack, book: BookMeta): ItemStack? {
|
||||||
|
|
@ -58,7 +59,7 @@ object AnvilLoreEditUtil {
|
||||||
if (meta.hasPages() && meta.pageCount >= 1) {
|
if (meta.hasPages() && meta.pageCount >= 1) {
|
||||||
// Test if the pages is ok
|
// Test if the pages is ok
|
||||||
for (page in meta.pages) {
|
for (page in meta.pages) {
|
||||||
if (page.isNotEmpty()) {
|
if (page.isNotBlank()) {
|
||||||
hasContent = true
|
hasContent = true
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
@ -68,9 +69,9 @@ object AnvilLoreEditUtil {
|
||||||
// We don't want to "add" the first page is there is content and the first page is empty
|
// We don't want to "add" the first page is there is content and the first page is empty
|
||||||
if (hasContent) {
|
if (hasContent) {
|
||||||
if (meta.pages[0].isEmpty()) return null
|
if (meta.pages[0].isEmpty()) return null
|
||||||
if (ConfigOptions.appendLoreBookAndQuil)
|
if (LoreEditType.APPEND_BOOK.enabled)
|
||||||
return true
|
return true
|
||||||
} else if (ConfigOptions.removeLoreBookAndQuil) {
|
} else if (LoreEditType.REMOVE_BOOK.enabled) {
|
||||||
if (!first.hasItemMeta()) return null
|
if (!first.hasItemMeta()) return null
|
||||||
|
|
||||||
val leftMeta = first.itemMeta!!
|
val leftMeta = first.itemMeta!!
|
||||||
|
|
@ -95,9 +96,9 @@ object AnvilLoreEditUtil {
|
||||||
|
|
||||||
val hasContent = meta.hasDisplayName()
|
val hasContent = meta.hasDisplayName()
|
||||||
if (hasContent) {
|
if (hasContent) {
|
||||||
if (ConfigOptions.appendLoreBookAndQuil)
|
if (LoreEditType.APPEND_PAPER.enabled)
|
||||||
return true
|
return true
|
||||||
} else if (ConfigOptions.removeLoreBookAndQuil) {
|
} else if (LoreEditType.REMOVE_PAPER.enabled) {
|
||||||
if (!first.hasItemMeta()) return null
|
if (!first.hasItemMeta()) return null
|
||||||
|
|
||||||
val leftMeta = first.itemMeta!!
|
val leftMeta = first.itemMeta!!
|
||||||
|
|
@ -116,7 +117,7 @@ object AnvilLoreEditUtil {
|
||||||
ArrayList<String>(meta.lore!!)
|
ArrayList<String>(meta.lore!!)
|
||||||
} else ArrayList()
|
} else ArrayList()
|
||||||
|
|
||||||
val appendEnd = ConfigOptions.paperLoreOrderIsEnd
|
val appendEnd = LoreEditConfigUtil.paperLoreOrderIsEnd
|
||||||
|
|
||||||
//TODO check color if color if enabled
|
//TODO check color if color if enabled
|
||||||
val line = second.itemMeta!!.displayName
|
val line = second.itemMeta!!.displayName
|
||||||
|
|
@ -138,7 +139,7 @@ object AnvilLoreEditUtil {
|
||||||
val result = first.clone()
|
val result = first.clone()
|
||||||
val meta = result.itemMeta!!
|
val meta = result.itemMeta!!
|
||||||
|
|
||||||
val removeEnd = ConfigOptions.paperLoreOrderIsEnd
|
val removeEnd = LoreEditConfigUtil.paperLoreOrderIsEnd
|
||||||
val lore: ArrayList<String> = ArrayList(meta.lore!!)
|
val lore: ArrayList<String> = ArrayList(meta.lore!!)
|
||||||
|
|
||||||
if(removeEnd) lore.removeAt(lore.size - 1)
|
if(removeEnd) lore.removeAt(lore.size - 1)
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,177 @@
|
||||||
|
package xyz.alexcrea.cuanvil.util.config
|
||||||
|
|
||||||
|
import xyz.alexcrea.cuanvil.config.ConfigHolder.DEFAULT_CONFIG as CONFIG
|
||||||
|
|
||||||
|
object LoreEditConfigUtil {
|
||||||
|
|
||||||
|
// Per edit type configs Path
|
||||||
|
const val IS_ENABLED = "enabled"
|
||||||
|
const val FIXED_COST = "fixed_cost"
|
||||||
|
const val PER_LINE_COST = "per_line_cost"
|
||||||
|
const val USE_COST_PENALTY = "use_cost_penalty"
|
||||||
|
const val INCREASE_COST_PENALTY = "increase_cost_penalty"
|
||||||
|
const val DO_CONSUME = "do_consume"
|
||||||
|
|
||||||
|
// Permission configs path
|
||||||
|
const val BOOK_PERMISSION_NEEDED = "lore_edit.book_and_quil.use_permission"
|
||||||
|
const val PAPER_PERMISSION_NEEDED = "lore_edit.paper.use_permission"
|
||||||
|
|
||||||
|
// Color configs path
|
||||||
|
const val COLOR_BOOK_COLOR_CODE = "lore_edit.book_and_quil.color.allow_color_code"
|
||||||
|
const val COLOR_BOOK_HEX = "lore_edit.book_and_quil.color.allow_hexadecimal_color"
|
||||||
|
const val COLOR_BOOK_COST = "lore_edit.book_and_quil.color.use_cost"
|
||||||
|
|
||||||
|
const val COLOR_PAPER_COLOR_CODE = "lore_edit.paper.color.allow_color_code"
|
||||||
|
const val COLOR_PAPER_HEX = "lore_edit.paper.color.allow_hexadecimal_color"
|
||||||
|
const val COLOR_PAPER_COST = "lore_edit.paper.color.use_cost"
|
||||||
|
|
||||||
|
// Lore order config path
|
||||||
|
const val PAPER_EDIT_ORDER = "lore_edit.paper.order"
|
||||||
|
|
||||||
|
// --------------
|
||||||
|
// Default Values
|
||||||
|
// --------------
|
||||||
|
|
||||||
|
// Per edit type configs defaults
|
||||||
|
const val DEFAULT_IS_ENABLED = true
|
||||||
|
const val DEFAULT_FIXED_COST = 1
|
||||||
|
const val DEFAULT_PER_LINE_COST = 0
|
||||||
|
const val DEFAULT_USE_COST_PENALTY = false
|
||||||
|
const val DEFAULT_INCREASE_COST_PENALTY = false
|
||||||
|
const val DEFAULT_DO_CONSUME = false
|
||||||
|
|
||||||
|
// Permission configs defaults
|
||||||
|
const val DEFAULT_BOOK_PERMISSION_NEEDED = true
|
||||||
|
const val DEFAULT_PAPER_PERMISSION_NEEDED = true
|
||||||
|
|
||||||
|
// Color configs defaults
|
||||||
|
const val DEFAULT_COLOR_BOOK_COLOR_CODE = true
|
||||||
|
const val DEFAULT_COLOR_BOOK_HEX = true
|
||||||
|
const val DEFAULT_COLOR_BOOK_COST = 0
|
||||||
|
|
||||||
|
const val DEFAULT_COLOR_PAPER_COLOR_CODE = true
|
||||||
|
const val DEFAULT_COLOR_PAPER_HEX = true
|
||||||
|
const val DEFAULT_COLOR_PAPER_COST = 0
|
||||||
|
|
||||||
|
// Lore order config default
|
||||||
|
const val DEFAULT_PAPER_EDIT_ORDER = "end"
|
||||||
|
|
||||||
|
// -------------
|
||||||
|
// Config Ranges
|
||||||
|
// -------------
|
||||||
|
|
||||||
|
val FIXED_COST_RANGE = 0..1000
|
||||||
|
val PER_LINE_COST_RANGE = 0..1000
|
||||||
|
|
||||||
|
val COLOR_BOOK_COST_RANGE = 0..1000
|
||||||
|
val COLOR_PAPER_COST_RANGE = 0..1000
|
||||||
|
|
||||||
|
// -------------------
|
||||||
|
// Generic Get methods
|
||||||
|
// -------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get if we should append/remove at the end or at the start of the lore list
|
||||||
|
* This may change to an "OrderType" enum or equivalent later
|
||||||
|
*/
|
||||||
|
val paperLoreOrderIsEnd: Boolean
|
||||||
|
get() {
|
||||||
|
return CONFIG
|
||||||
|
.config
|
||||||
|
.getString(PAPER_EDIT_ORDER, DEFAULT_PAPER_EDIT_ORDER)
|
||||||
|
.equals(DEFAULT_PAPER_EDIT_ORDER, ignoreCase = true)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If lore edit via book need permission
|
||||||
|
*/
|
||||||
|
val bookLoreEditNeedPermission: Boolean
|
||||||
|
get() {
|
||||||
|
return CONFIG
|
||||||
|
.config
|
||||||
|
.getBoolean(BOOK_PERMISSION_NEEDED, DEFAULT_BOOK_PERMISSION_NEEDED)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If lore edit via paper need permission
|
||||||
|
*/
|
||||||
|
val paperLoreEditNeedPermission: Boolean
|
||||||
|
get() {
|
||||||
|
return CONFIG
|
||||||
|
.config
|
||||||
|
.getBoolean(PAPER_PERMISSION_NEEDED, DEFAULT_PAPER_PERMISSION_NEEDED)
|
||||||
|
}
|
||||||
|
|
||||||
|
// -----------------
|
||||||
|
// Color Get methods
|
||||||
|
// -----------------
|
||||||
|
|
||||||
|
// book edit functions
|
||||||
|
/**
|
||||||
|
* Allow usage of color code on book lore edit
|
||||||
|
*/
|
||||||
|
val bookAllowColorCode: Boolean
|
||||||
|
get() {
|
||||||
|
return CONFIG
|
||||||
|
.config
|
||||||
|
.getBoolean(COLOR_BOOK_COLOR_CODE, DEFAULT_COLOR_BOOK_COLOR_CODE)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allow usage of hexadecimal color on book lore edit
|
||||||
|
*/
|
||||||
|
val bookAllowHexColor: Boolean
|
||||||
|
get() {
|
||||||
|
return CONFIG
|
||||||
|
.config
|
||||||
|
.getBoolean(COLOR_BOOK_HEX, DEFAULT_COLOR_BOOK_HEX)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Cost when using either color code and hex color on book edit
|
||||||
|
*/
|
||||||
|
val bookUseColorCost: Int
|
||||||
|
get() {
|
||||||
|
return CONFIG
|
||||||
|
.config
|
||||||
|
.getInt(COLOR_BOOK_COST, DEFAULT_COLOR_BOOK_COST)
|
||||||
|
.takeIf { it in COLOR_BOOK_COST_RANGE }
|
||||||
|
?: DEFAULT_COLOR_BOOK_COST
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// paper edit functions
|
||||||
|
/**
|
||||||
|
* Allow usage of color code on paper lore edit
|
||||||
|
*/
|
||||||
|
val paperAllowColorCode: Boolean
|
||||||
|
get() {
|
||||||
|
return CONFIG
|
||||||
|
.config
|
||||||
|
.getBoolean(COLOR_PAPER_COLOR_CODE, DEFAULT_COLOR_PAPER_COLOR_CODE)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allow usage of hexadecimal color on paper lore edit
|
||||||
|
*/
|
||||||
|
val paperAllowHexColor: Boolean
|
||||||
|
get() {
|
||||||
|
return CONFIG
|
||||||
|
.config
|
||||||
|
.getBoolean(COLOR_PAPER_HEX, DEFAULT_COLOR_PAPER_HEX)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Cost when using either color code and hex color on paper edit
|
||||||
|
*/
|
||||||
|
val paperUseColorCost: Int
|
||||||
|
get() {
|
||||||
|
return CONFIG
|
||||||
|
.config
|
||||||
|
.getInt(COLOR_PAPER_COST, DEFAULT_COLOR_PAPER_COST)
|
||||||
|
.takeIf { it in COLOR_PAPER_COST_RANGE }
|
||||||
|
?: DEFAULT_COLOR_PAPER_COST
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,87 @@
|
||||||
|
package xyz.alexcrea.cuanvil.util.config
|
||||||
|
|
||||||
|
import xyz.alexcrea.cuanvil.config.ConfigHolder.DEFAULT_CONFIG as CONFIG
|
||||||
|
|
||||||
|
enum class LoreEditType(
|
||||||
|
val rootPath: String,
|
||||||
|
val isAppend: Boolean,
|
||||||
|
) {
|
||||||
|
APPEND_BOOK("lore_edit.book_and_quil.append", true),
|
||||||
|
REMOVE_BOOK("lore_edit.book_and_quil.remove", false),
|
||||||
|
APPEND_PAPER("lore_edit.paper.append", true),
|
||||||
|
REMOVE_PAPER("lore_edit.paper.remove", false),
|
||||||
|
;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If this edit type is enabled
|
||||||
|
*/
|
||||||
|
val enabled: Boolean
|
||||||
|
get() {
|
||||||
|
return CONFIG
|
||||||
|
.config
|
||||||
|
.getBoolean("${rootPath}.${LoreEditConfigUtil.IS_ENABLED}", LoreEditConfigUtil.DEFAULT_IS_ENABLED)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fixed cost added to this edit
|
||||||
|
*/
|
||||||
|
val fixedCost: Int
|
||||||
|
get() {
|
||||||
|
return CONFIG
|
||||||
|
.config
|
||||||
|
.getInt("${rootPath}.${LoreEditConfigUtil.FIXED_COST}", LoreEditConfigUtil.DEFAULT_FIXED_COST)
|
||||||
|
.takeIf { it in LoreEditConfigUtil.FIXED_COST_RANGE }
|
||||||
|
?: LoreEditConfigUtil.DEFAULT_FIXED_COST
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Cost added per line added
|
||||||
|
*/
|
||||||
|
val perLineCost: Int
|
||||||
|
get() {
|
||||||
|
return CONFIG
|
||||||
|
.config
|
||||||
|
.getInt("${rootPath}.${LoreEditConfigUtil.PER_LINE_COST}", LoreEditConfigUtil.DEFAULT_PER_LINE_COST)
|
||||||
|
.takeIf { it in LoreEditConfigUtil.PER_LINE_COST_RANGE }
|
||||||
|
?: LoreEditConfigUtil.DEFAULT_PER_LINE_COST
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If the edit should use the item's cost penalty
|
||||||
|
*/
|
||||||
|
val useCostPenalty: Boolean
|
||||||
|
get() {
|
||||||
|
return CONFIG
|
||||||
|
.config
|
||||||
|
.getBoolean(
|
||||||
|
"${rootPath}.${LoreEditConfigUtil.USE_COST_PENALTY}",
|
||||||
|
LoreEditConfigUtil.DEFAULT_USE_COST_PENALTY
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If the edit should increase the items cost penalty
|
||||||
|
*/
|
||||||
|
val increaseCostPenalty: Boolean
|
||||||
|
get() {
|
||||||
|
|
||||||
|
return CONFIG
|
||||||
|
.config
|
||||||
|
.getBoolean(
|
||||||
|
"${rootPath}.${LoreEditConfigUtil.INCREASE_COST_PENALTY}",
|
||||||
|
LoreEditConfigUtil.DEFAULT_INCREASE_COST_PENALTY
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If the edit should consume the provided material
|
||||||
|
*/
|
||||||
|
val doConsume: Boolean
|
||||||
|
get() {
|
||||||
|
if (!isAppend) throw IllegalStateException("Lore edit Consume test should not happen on append")
|
||||||
|
return CONFIG
|
||||||
|
.config
|
||||||
|
.getBoolean("${rootPath}.${LoreEditConfigUtil.DO_CONSUME}", LoreEditConfigUtil.DEFAULT_DO_CONSUME)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -273,18 +273,80 @@ disable-merge-over:
|
||||||
# Settings for lore modification
|
# Settings for lore modification
|
||||||
lore_edit:
|
lore_edit:
|
||||||
book_and_quil:
|
book_and_quil:
|
||||||
|
# Permission is ca.lore_edit.book
|
||||||
use_permission: true
|
use_permission: true
|
||||||
# permission is ca.lore_edit.book
|
append:
|
||||||
append: false
|
# If adding lore using book & quil is enabled
|
||||||
remove: false
|
enabled: false
|
||||||
|
# Cost used every time
|
||||||
|
fixed_cost: 1
|
||||||
|
# Cost used for every lore line added
|
||||||
|
per_line_cost: 0
|
||||||
|
# Use left item cost penalty if any
|
||||||
|
use_cost_penalty: false
|
||||||
|
# Increase left item cost penalty
|
||||||
|
increase_cost_penalty: false
|
||||||
|
# If adding the lore consume the book & quil
|
||||||
|
do_consume: false
|
||||||
|
|
||||||
|
remove:
|
||||||
|
# If removing lore using book & quil is enabled
|
||||||
|
enabled: false
|
||||||
|
# Cost used every time
|
||||||
|
fixed_cost: 1
|
||||||
|
# Cost used for every lore line removed
|
||||||
|
per_line_cost: 0
|
||||||
|
# Use left item cost penalty if any
|
||||||
|
use_cost_penalty: false
|
||||||
|
# Increase left item cost penalty
|
||||||
|
increase_cost_penalty: false
|
||||||
|
|
||||||
|
# Allow using color code and hexadecimal color when editing lore via book & quil
|
||||||
|
#
|
||||||
|
# Color code are prefixed by "&" and hexadecimal color by "#"
|
||||||
|
# Color code will not be applied if it colors nothing. "&&" can be used to write "&"
|
||||||
|
color:
|
||||||
|
allow_color_code: true
|
||||||
|
allow_hexadecimal_color: true
|
||||||
|
use_cost: 0
|
||||||
|
|
||||||
paper:
|
paper:
|
||||||
|
# Permission is ca.lore_edit.paper
|
||||||
use_permission: true
|
use_permission: true
|
||||||
# permission is ca.lore_edit.paper
|
|
||||||
append_line: false
|
|
||||||
remove_line: false
|
|
||||||
# what order should the lines should get added/removed (start/end, if invalid or not present will be end)
|
# what order should the lines should get added/removed (start/end, if invalid or not present will be end)
|
||||||
order: "end"
|
order: "end"
|
||||||
|
|
||||||
|
append_line:
|
||||||
|
# If adding lore line using paper is enabled
|
||||||
|
enabled: false
|
||||||
|
# Cost used every time
|
||||||
|
fixed_cost: 1
|
||||||
|
# Use left item cost penalty if any
|
||||||
|
use_cost_penalty: false
|
||||||
|
# Increase left item cost penalty
|
||||||
|
increase_cost_penalty: false
|
||||||
|
# If adding the lore line consume the paper
|
||||||
|
do_consume: false
|
||||||
|
|
||||||
|
remove_line:
|
||||||
|
# If removing lore line using paper is enabled
|
||||||
|
enabled: false
|
||||||
|
# Cost used every time
|
||||||
|
fixed_cost: 1
|
||||||
|
# Use left item cost penalty if any
|
||||||
|
use_cost_penalty: false
|
||||||
|
# Increase left item cost penalty
|
||||||
|
increase_cost_penalty: false
|
||||||
|
|
||||||
|
# Allow using color code and hexadecimal color when editing lore via book & quil
|
||||||
|
#
|
||||||
|
# Color code are prefixed by "&" and hexadecimal color by "#"
|
||||||
|
# Color code will not be applied if it colors nothing. "&&" can be used to write "&"
|
||||||
|
color:
|
||||||
|
allow_color_code: true
|
||||||
|
allow_hexadecimal_color: true
|
||||||
|
use_cost: 0
|
||||||
|
|
||||||
# Whether to show debug logging
|
# Whether to show debug logging
|
||||||
debug_log: false
|
debug_log: false
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue