Fixed java/kotlin conflict
This commit is contained in:
@@ -100,7 +100,7 @@ object RaritySorter : EnchantmentSorter {
|
||||
|
||||
for (rarity in rarities) {
|
||||
for (enchantment in children.getSafely(0).sort(enchantments, children.drop(1))) {
|
||||
if (rarity != enchantment.wrap().rarity) {
|
||||
if (rarity != enchantment.wrap().enchantmentRarity) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ abstract class EcoEnchant(
|
||||
|
||||
override val type = EnchantmentTypes.getByID(config.getString("type")) ?: EnchantmentTypes.values().first()
|
||||
|
||||
override val rarity =
|
||||
override val enchantmentRarity =
|
||||
EnchantmentRarities.getByID(config.getString("rarity")) ?: EnchantmentRarities.values().first()
|
||||
|
||||
private val conflictNames = config.getStrings("conflicts")
|
||||
|
||||
@@ -27,7 +27,7 @@ interface EcoEnchantLike {
|
||||
val displayName: String
|
||||
val unformattedDisplayName: String
|
||||
val enchant: Enchantment
|
||||
val rarity: EnchantmentRarity
|
||||
val enchantmentRarity: EnchantmentRarity
|
||||
|
||||
// Includes all extra logic not found in vanilla canEnchantItem
|
||||
fun canEnchantItem(item: ItemStack): Boolean
|
||||
@@ -103,7 +103,7 @@ class VanillaEcoEnchantLike(
|
||||
EnchantmentTypes.getByID(plugin.vanillaEnchantsYml.getString("${enchant.key.key}.type"))
|
||||
?: EnchantmentTypes.values().first()
|
||||
|
||||
override val rarity: EnchantmentRarity =
|
||||
override val enchantmentRarity: EnchantmentRarity =
|
||||
EnchantmentRarities.getByID(plugin.vanillaEnchantsYml.getString("${enchant.key.key}.rarity"))
|
||||
?: EnchantmentRarities.values().first()
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ object EnchantInfo {
|
||||
plugin.configYml.getStrings("enchantinfo.item.lore")
|
||||
.map {
|
||||
it.replace("%max_level%", enchant.maxLevel.toString())
|
||||
.replace("%rarity%", enchant.rarity.displayName)
|
||||
.replace("%rarity%", enchant.enchantmentRarity.displayName)
|
||||
.replace(
|
||||
"%targets%",
|
||||
enchant.targets.joinToString(", ") { target -> target.displayName }
|
||||
|
||||
@@ -91,11 +91,11 @@ class EnchantingTableSupport(
|
||||
continue
|
||||
}
|
||||
|
||||
if (NumberUtils.randFloat(0.0, 1.0) > enchantment.rarity.tableChance * multiplier) {
|
||||
if (NumberUtils.randFloat(0.0, 1.0) > enchantment.enchantmentRarity.tableChance * multiplier) {
|
||||
continue
|
||||
}
|
||||
|
||||
if (enchantment.rarity.minimumLevel > cost) {
|
||||
if (enchantment.enchantmentRarity.minimumLevel > cost) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ class LootSupport(
|
||||
continue
|
||||
}
|
||||
|
||||
if (NumberUtils.randFloat(0.0, 1.0) > enchantment.rarity.lootChance * multiplier) {
|
||||
if (NumberUtils.randFloat(0.0, 1.0) > enchantment.enchantmentRarity.lootChance * multiplier) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ class VillagerSupport(
|
||||
continue
|
||||
}
|
||||
|
||||
if (NumberUtils.randFloat(0.0, 1.0) > enchantment.rarity.villagerChance * multiplier) {
|
||||
if (NumberUtils.randFloat(0.0, 1.0) > enchantment.enchantmentRarity.villagerChance * multiplier) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user