Merge pull request #352
Fixed soulbound compatibility with WorldGuardExtraFlags (and probably…
This commit is contained in:
@@ -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"
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -17,5 +17,7 @@ messages:
|
||||
|
||||
|
||||
all: "All"
|
||||
yes: "&aYes"
|
||||
no: "&cNo"
|
||||
no-conflicts: "No Conflicts"
|
||||
all-conflicts: "All Other Enchantments"
|
||||
Reference in New Issue
Block a user