MasterCake 4 years ago
parent
commit
cf6df8f41a
2 changed files with 9 additions and 3 deletions
  1. 1 1
      pom.xml
  2. 8 2
      src/xyz/spaceio/configutils/ConfigHandler.java

+ 1 - 1
pom.xml

@@ -4,7 +4,7 @@
 	<modelVersion>4.0.0</modelVersion>
 	<groupId>xyz.spaceio</groupId>
 	<artifactId>CustomOreGen</artifactId>
-	<version>1.3.18-SNAPSHOT</version>
+	<version>1.3.19-SNAPSHOT</version>
 	<repositories>
 		<!-- Spigot repository -->
 		<repository>

+ 8 - 2
src/xyz/spaceio/configutils/ConfigHandler.java

@@ -67,8 +67,14 @@ public class ConfigHandler {
 			}
 			gc.label = plugin.getConfig().getString("generators." + key + ".label", key);
 
-			for (String raw : plugin.getConfig().getStringList("generators." + key + ".blocks")) {
+			for (Object obj : plugin.getConfig().getList("generators." + key + ".blocks")) {
 				try {
+					String raw = obj.toString();
+					if(raw.startsWith("{")) {
+						raw = raw.substring(1, raw.length() - 1);
+						raw = raw.replace("=", ":");
+					}
+
 					if (!raw.contains("!")) {
 						String material = raw.split(":")[0];
 						if (Material.getMaterial(material.toUpperCase()) == null) {
@@ -94,7 +100,7 @@ public class ConfigHandler {
 					plugin.sendConsole("&cConfig error: general configuration error. Please check you config.yml");
 				}
 			}
-			if (totalChance != 100.0) {
+			if (Math.round(totalChance) != 100f) {
 				plugin.sendConsole(String.format(
 						"&cConfig error: generator %s does not have a total chance of 100.0! Total chance is: %f", key,
 						totalChance));