Skip to content

Commit

Permalink
Merge pull request #18 from Tofpu/v1.0.6-patch
Browse files Browse the repository at this point in the history
v1.0.6 patch
  • Loading branch information
Tofpu authored Mar 17, 2022
2 parents 1876dc2 + 7e3b8e2 commit 674f9b1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
}

group = "io.tofpu.speedbridge2"
version = "1.0.5"
version = "1.0.6"

tasks {
compileJava {
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -10,18 +11,23 @@
public final class BlockMenuCategory {

@Setting("blocks")
private List<Material> materials = new ArrayList<>(Arrays.asList(Material.WOOL,
private List<Material> 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));

@Setting("default_block")
private Material defaultBlock = materials.isEmpty() ? Material.AIR : materials.get(0);

public Collection<Material> 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();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,9 @@ public void load(final Plugin plugin) {
public CompletableFuture<Void> 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());
Expand Down

0 comments on commit 674f9b1

Please sign in to comment.