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
|
* Get default value if enchantment do not exist on config
|
||||||
*/
|
*/
|
||||||
private fun getDefaultValue(
|
private fun getDefaultValue(
|
||||||
enchantment: CAEnchantment, // compatibility with 1.20.5. TODO better update system
|
enchantment: CAEnchantment,
|
||||||
isFromBook: Boolean
|
isFromBook: Boolean
|
||||||
): Int {
|
): 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()
|
val rarity = enchantment.defaultRarity()
|
||||||
return if (isFromBook)
|
return if (isFromBook)
|
||||||
rarity.bookValue
|
rarity.bookValue
|
||||||
|
|
@ -648,15 +637,6 @@ object ConfigOptions {
|
||||||
value = maxBeforeMergeDisabled(legacy)
|
value = maxBeforeMergeDisabled(legacy)
|
||||||
if (value >= 0) return value
|
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
|
return DEFAULT_MAX_BEFORE_MERGE_DISABLED
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -39,13 +39,6 @@ class EnchantConflictManager {
|
||||||
|
|
||||||
// Default name for a joining group
|
// Default name for a joining group
|
||||||
const val DEFAULT_GROUP_NAME = "joinedGroup"
|
const val DEFAULT_GROUP_NAME = "joinedGroup"
|
||||||
|
|
||||||
// 1.20.5 compatibility TODO better update system
|
|
||||||
private val SWEEPING_EDGE_ENCHANT = Collections.singletonList<CAEnchantment>(
|
|
||||||
CAEnchantment.getByKey(NamespacedKey.minecraft("sweeping_edge"))
|
|
||||||
?: CAEnchantment.getByKey(Enchantment.SWEEPING_EDGE.key)
|
|
||||||
)
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
lateinit var conflictList: ArrayList<EnchantConflictGroup>
|
lateinit var conflictList: ArrayList<EnchantConflictGroup>
|
||||||
|
|
@ -172,14 +165,6 @@ class EnchantConflictManager {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Temporary solution for 1.20.5
|
|
||||||
when (enchantName) {
|
|
||||||
"minecraft:sweeping", "sweeping",
|
|
||||||
"minecraft:sweeping_edge", "sweeping_edge" -> {
|
|
||||||
return SWEEPING_EDGE_ENCHANT
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return CAEnchantment.getListByName(enchantName)
|
return CAEnchantment.getListByName(enchantName)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue