mirror of
https://github.com/Auxilor/EcoEnchants.git
synced 2024-11-28 16:05:14 +01:00
Fixed targets
This commit is contained in:
parent
39076eef7a
commit
d5bd2b3efd
@ -11,6 +11,7 @@ import com.willfp.libreforge.slot.SlotTypes
|
|||||||
import com.willfp.libreforge.slot.impl.SlotTypeAny
|
import com.willfp.libreforge.slot.impl.SlotTypeAny
|
||||||
import org.bukkit.entity.Player
|
import org.bukkit.entity.Player
|
||||||
import org.bukkit.inventory.ItemStack
|
import org.bukkit.inventory.ItemStack
|
||||||
|
import java.lang.IllegalArgumentException
|
||||||
import java.util.Objects
|
import java.util.Objects
|
||||||
|
|
||||||
interface EnchantmentTarget : Registrable {
|
interface EnchantmentTarget : Registrable {
|
||||||
@ -39,7 +40,8 @@ class ConfiguredEnchantmentTarget(
|
|||||||
override val id = config.getString("id")
|
override val id = config.getString("id")
|
||||||
override val displayName = config.getFormattedString("display-name")
|
override val displayName = config.getFormattedString("display-name")
|
||||||
|
|
||||||
override val slot = SlotTypes[config.getString("slot")]!!
|
override val slot = SlotTypes[config.getString("slot")] ?:
|
||||||
|
throw IllegalArgumentException("Invalid slot type: ${config.getString("slot")}, options are ${SlotTypes.values().map { it.id }}")
|
||||||
|
|
||||||
override val items = config.getStrings("items")
|
override val items = config.getStrings("items")
|
||||||
.map { Items.lookup(it) }
|
.map { Items.lookup(it) }
|
||||||
|
@ -176,7 +176,7 @@ targets:
|
|||||||
|
|
||||||
- id: shield
|
- id: shield
|
||||||
display-name: "Shields"
|
display-name: "Shields"
|
||||||
slot: mainhands
|
slot: hands
|
||||||
items:
|
items:
|
||||||
- "*shield"
|
- "*shield"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user