Fix value written as set in yml.

Fix material group not being added at to the registry.
Fix EnchantmentSquared restriction not having enchantment.
Added plugin's instance as conflict source.
This commit is contained in:
alexcrea 2024-07-11 00:52:13 +02:00
parent fc7e85529c
commit ac7f975b02
No known key found for this signature in database
GPG key ID: 43FD265DB0DBF91F
4 changed files with 33 additions and 24 deletions

View file

@ -110,7 +110,8 @@ class EnchantmentSquaredDependency(private val enchantmentSquaredPlugin: Plugin)
private fun writeMaterialRestriction(esEnchantments: List<CAEnchantSquaredEnchantment>){
for (enchantment in esEnchantments) {
val conflict = ConflictBuilder("restriction_${enchantment.key.key}")
val conflict = ConflictBuilder("restriction_${enchantment.key.key}", CustomAnvil.instance)
conflict.addEnchantment(enchantment)
// enchanted book is allowed in any case.
conflict.addExcludedGroup("enchanted_book")
@ -146,7 +147,7 @@ class EnchantmentSquaredDependency(private val enchantmentSquaredPlugin: Plugin)
}
private fun writeConflict(enchantment1: CAEnchantment, enchantment2: CAEnchantment){
val conflict = ConflictBuilder("${enchantment1.name}_with_${enchantment2.name}_conflict")
val conflict = ConflictBuilder("${enchantment1.name}_with_${enchantment2.name}_conflict", CustomAnvil.instance)
conflict.addEnchantment(enchantment1).addEnchantment(enchantment2)