Merge pull request #352

Fixed soulbound compatibility with WorldGuardExtraFlags (and probably…
This commit is contained in:
Will FP
2023-04-20 12:59:05 -04:00
committed by GitHub
3 changed files with 15 additions and 1 deletions

View File

@@ -21,6 +21,7 @@ import com.willfp.eco.core.items.builder.ItemStackBuilder
import com.willfp.eco.core.items.isEmpty
import com.willfp.eco.util.StringUtils
import com.willfp.eco.util.formatEco
import com.willfp.eco.util.toNiceString
import com.willfp.ecoenchants.EcoEnchantsPlugin
import com.willfp.ecoenchants.display.EnchantSorter.sortForDisplay
import com.willfp.ecoenchants.display.getFormattedName
@@ -261,6 +262,12 @@ private fun EcoEnchant.getInformationSlot(plugin: EcoEnchantsPlugin): Slot {
}.ifEmpty { plugin.langYml.getFormattedString("no-conflicts").toWrappable() }
}
)
.replace("%tradeable%", plugin.langYml
.getFormattedString(this.isTradeable.yesOrNo))
.replace("%discoverable%", plugin.langYml
.getFormattedString(this.isDiscoverable.yesOrNo))
.replace("%enchantable%", plugin.langYml
.getFormattedString(this.isEnchantable.yesOrNo))
}
.flatMap {
WordUtils.wrap(it, 45, "\n", false)
@@ -279,3 +286,8 @@ private fun EcoEnchant.getInformationSlot(plugin: EcoEnchantsPlugin): Slot {
)
}
}
val Boolean.yesOrNo: String
get() {
return if (this) "yes" else "no"
}

View File

@@ -45,7 +45,7 @@ class EnchantmentSoulbound(
private val soulboundKey = plugin.namespacedKeyFactory.create("soulbound")
@EventHandler(
priority = EventPriority.LOW,
priority = EventPriority.HIGHEST,
ignoreCancelled = true
)
fun handle(event: PlayerDeathEvent) {

View File

@@ -17,5 +17,7 @@ messages:
all: "All"
yes: "&aYes"
no: "&cNo"
no-conflicts: "No Conflicts"
all-conflicts: "All Other Enchantments"