Improvements to NMS registration

This commit is contained in:
Will FP 2023-12-08 12:50:26 +00:00
parent b88a1483e1
commit 0b27b46d48
2 changed files with 17 additions and 0 deletions

View File

@ -111,4 +111,8 @@ class DelegatedCraftEnchantment(
override fun hashCode(): Int {
return Objects.hash(this.key)
}
override fun toString(): String {
return "DelegatedCraftEnchantment(key=$key)"
}
}

View File

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