mirror of
https://github.com/alexcrea/CustomAnvil.git
synced 2026-08-28 08:25:56 +02:00
remove legacy compatibility code
This commit is contained in:
parent
f1c3cf46e1
commit
d67d998dc1
2 changed files with 1 additions and 36 deletions
|
|
@ -613,20 +613,9 @@ object ConfigOptions {
|
|||
* Get default value if enchantment do not exist on config
|
||||
*/
|
||||
private fun getDefaultValue(
|
||||
enchantment: CAEnchantment, // compatibility with 1.20.5. TODO better update system
|
||||
enchantment: CAEnchantment,
|
||||
isFromBook: Boolean
|
||||
): Int {
|
||||
|
||||
val enchantmentName = enchantment.key.toString()
|
||||
if (enchantmentName == "minecraft:sweeping_edge") {
|
||||
var limit = enchantmentValue("minecraft:sweeping", isFromBook)
|
||||
if (limit != null) return limit
|
||||
|
||||
// legacy name
|
||||
limit = enchantmentValue("sweeping", isFromBook)
|
||||
if (limit != null) return limit
|
||||
}
|
||||
|
||||
val rarity = enchantment.defaultRarity()
|
||||
return if (isFromBook)
|
||||
rarity.bookValue
|
||||
|
|
@ -648,15 +637,6 @@ object ConfigOptions {
|
|||
value = maxBeforeMergeDisabled(legacy)
|
||||
if (value >= 0) return value
|
||||
|
||||
if (key == "minecraft:sweeping_edge") {
|
||||
value = maxBeforeMergeDisabled("minecraft:sweeping")
|
||||
if (value >= 0) return value
|
||||
|
||||
// legacy name of legacy enchantment name
|
||||
value = maxBeforeMergeDisabled("sweeping")
|
||||
if (value >= 0) return value
|
||||
}
|
||||
|
||||
return DEFAULT_MAX_BEFORE_MERGE_DISABLED
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue