diff --git a/build.gradle.kts b/build.gradle.kts index 624ef7a0..ea6f147c 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -5,7 +5,7 @@ plugins { } group = "io.tofpu.speedbridge2" -version = "1.0.5" +version = "1.0.6" tasks { compileJava { diff --git a/src/main/java/io/tofpu/speedbridge2/domain/common/config/category/BlockMenuCategory.java b/src/main/java/io/tofpu/speedbridge2/domain/common/config/category/BlockMenuCategory.java index a4fe2a3b..84637491 100644 --- a/src/main/java/io/tofpu/speedbridge2/domain/common/config/category/BlockMenuCategory.java +++ b/src/main/java/io/tofpu/speedbridge2/domain/common/config/category/BlockMenuCategory.java @@ -1,5 +1,6 @@ package io.tofpu.speedbridge2.domain.common.config.category; +import com.cryptomorin.xseries.XMaterial; import org.bukkit.Material; import org.spongepowered.configurate.objectmapping.ConfigSerializable; import org.spongepowered.configurate.objectmapping.meta.Setting; @@ -10,7 +11,8 @@ public final class BlockMenuCategory { @Setting("blocks") - private List materials = new ArrayList<>(Arrays.asList(Material.WOOL, + private List materials = + new ArrayList<>(Arrays.asList(toMaterial(XMaterial.WHITE_WOOL), Material.DIAMOND_BLOCK, Material.GOLD_BLOCK, Material.IRON_BLOCK, Material.REDSTONE_BLOCK, Material.LAPIS_BLOCK, Material.QUARTZ_BLOCK)); @@ -18,10 +20,14 @@ public final class BlockMenuCategory { private Material defaultBlock = materials.isEmpty() ? Material.AIR : materials.get(0); public Collection getMaterialBlocks() { - return materials; + return materials.subList(0, Math.min(7, materials.size())); } public Material getDefaultBlock() { return defaultBlock; } + + public static Material toMaterial(final XMaterial xMaterial) { + return xMaterial.parseMaterial(); + } } diff --git a/src/main/java/io/tofpu/speedbridge2/domain/common/config/manager/ConfigurationManager.java b/src/main/java/io/tofpu/speedbridge2/domain/common/config/manager/ConfigurationManager.java index 9e318fd1..33fde683 100644 --- a/src/main/java/io/tofpu/speedbridge2/domain/common/config/manager/ConfigurationManager.java +++ b/src/main/java/io/tofpu/speedbridge2/domain/common/config/manager/ConfigurationManager.java @@ -72,8 +72,9 @@ public void load(final Plugin plugin) { public CompletableFuture reload() { return CompletableFuture.runAsync(() -> { try { + this.node = loader.load(); this.configuration = node.get(PluginConfiguration.class); - } catch (SerializationException e) { + } catch (ConfigurateException e) { plugin.getLogger() .warning("An error occurred while converting MyConfiguration: " + e.getMessage());