From 8eb196caaad2f9fac3c3a7271e46ad33a7df1b1e Mon Sep 17 00:00:00 2001 From: BuildTools Date: Sat, 27 Mar 2021 05:48:50 +0800 Subject: [PATCH] a --- .../thebusybiscuit/slimefun4/api/items/ItemSetting.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/ItemSetting.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/ItemSetting.java index 664498a26..b753f9c1e 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/ItemSetting.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/ItemSetting.java @@ -9,6 +9,8 @@ import io.github.thebusybiscuit.cscorelib2.config.Config; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; +import java.util.List; + /** * This class represents a Setting for a {@link SlimefunItem} that can be modified via * the {@code Items.yml} {@link Config} file. @@ -149,7 +151,7 @@ public class ItemSetting { SlimefunPlugin.getItemCfg().setDefaultValue(item.getId() + '.' + getKey(), getDefaultValue()); Object configuredValue = SlimefunPlugin.getItemCfg().getValue(item.getId() + '.' + getKey()); - if (defaultValue.getClass().isInstance(configuredValue)) { + if (defaultValue.getClass().isInstance(configuredValue) || (configuredValue instanceof List && defaultValue instanceof List)) { // We can do an unsafe cast here, we did an isInstance(...) check before! T newValue = (T) configuredValue;