Fixed java/kotlin conflict

This commit is contained in:
Auxilor
2022-09-25 19:16:55 +01:00
parent 3dacd27178
commit b1c5fafd60
7 changed files with 9 additions and 9 deletions

View File

@@ -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
}

View File

@@ -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")

View File

@@ -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()

View File

@@ -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 }

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}