Skip to content

Commit

Permalink
Merge branch 'Auxilor:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
LangZongz authored Dec 9, 2023
2 parents b74c503 + 48fd2dd commit 7f4bbcd
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.willfp.ecoenchants.proxy.v1_20_R3.registration

import com.willfp.eco.util.StringUtils
import com.willfp.eco.util.toComponent
import com.willfp.ecoenchants.display.getFormattedName
import com.willfp.ecoenchants.enchant.EcoEnchant
import io.papermc.paper.enchantments.EnchantmentRarity
Expand Down Expand Up @@ -64,7 +64,7 @@ class DelegatedCraftEnchantment(
}

override fun displayName(level: Int): Component {
return StringUtils.toComponent(enchant.getFormattedName(level))
return enchant.getFormattedName(level).toComponent()
}

override fun isTradeable(): Boolean {
Expand Down Expand Up @@ -111,4 +111,8 @@ class DelegatedCraftEnchantment(
override fun hashCode(): Int {
return Objects.hash(this.key)
}

override fun toString(): String {
return "DelegatedCraftEnchantment(key=$key)"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import net.minecraft.world.item.enchantment.Enchantment
import net.minecraft.world.item.enchantment.EnchantmentCategory
import org.bukkit.craftbukkit.v1_20_R3.enchantments.CraftEnchantment
import org.bukkit.craftbukkit.v1_20_R3.inventory.CraftItemStack
import java.util.Objects

class VanillaEcoEnchantsEnchantment(
private val id: String
Expand Down Expand Up @@ -81,4 +82,16 @@ class VanillaEcoEnchantsEnchantment(
override fun getSlotItems(entity: LivingEntity): MutableMap<EquipmentSlot, ItemStack> {
return mutableMapOf()
}

override fun toString(): String {
return "VanillaEcoEnchantsEnchantment(id='$id')"
}

override fun equals(other: Any?): Boolean {
return other is VanillaEcoEnchantsEnchantment && other.id == this.id
}

override fun hashCode(): Int {
return Objects.hash(id)
}
}

0 comments on commit 7f4bbcd

Please sign in to comment.