mirror of
https://github.com/Auxilor/EcoEnchants.git
synced 2024-11-25 15:35:11 +01:00
Improved 1.20.4 enchantments
This commit is contained in:
parent
bf012dff02
commit
9e08069aec
@ -1,7 +1,12 @@
|
|||||||
package com.willfp.ecoenchants.proxy.v1_20_R3.registration
|
package com.willfp.ecoenchants.proxy.v1_20_R3.registration
|
||||||
|
|
||||||
|
import com.willfp.eco.core.Prerequisite
|
||||||
|
import com.willfp.eco.util.toComponent
|
||||||
|
import com.willfp.ecoenchants.display.getFormattedName
|
||||||
import com.willfp.ecoenchants.enchant.EcoEnchant
|
import com.willfp.ecoenchants.enchant.EcoEnchant
|
||||||
import com.willfp.ecoenchants.enchant.EcoEnchants
|
import com.willfp.ecoenchants.enchant.EcoEnchants
|
||||||
|
import io.papermc.paper.adventure.PaperAdventure
|
||||||
|
import net.minecraft.network.chat.Component
|
||||||
import net.minecraft.world.damagesource.DamageSource
|
import net.minecraft.world.damagesource.DamageSource
|
||||||
import net.minecraft.world.entity.Entity
|
import net.minecraft.world.entity.Entity
|
||||||
import net.minecraft.world.entity.EquipmentSlot
|
import net.minecraft.world.entity.EquipmentSlot
|
||||||
@ -108,6 +113,15 @@ class VanillaEcoEnchantsEnchantment(
|
|||||||
return mutableMapOf()
|
return mutableMapOf()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun getFullname(level: Int): Component {
|
||||||
|
val enchant = this.enchant
|
||||||
|
return if (Prerequisite.HAS_PAPER.isMet && enchant != null) {
|
||||||
|
PaperAdventure.asVanilla(enchant.getFormattedName(level).toComponent())
|
||||||
|
} else {
|
||||||
|
super.getFullname(level)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
override fun toString(): String {
|
override fun toString(): String {
|
||||||
return "VanillaEcoEnchantsEnchantment(id='$id')"
|
return "VanillaEcoEnchantsEnchantment(id='$id')"
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user