MasterCake 5 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>
 	<modelVersion>4.0.0</modelVersion>
 	<groupId>xyz.spaceio</groupId>
 	<groupId>xyz.spaceio</groupId>
 	<artifactId>CustomOreGen</artifactId>
 	<artifactId>CustomOreGen</artifactId>
-	<version>1.3.18-SNAPSHOT</version>
+	<version>1.3.19-SNAPSHOT</version>
 	<repositories>
 	<repositories>
 		<!-- Spigot repository -->
 		<!-- Spigot repository -->
 		<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);
 			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 {
 				try {
+					String raw = obj.toString();
+					if(raw.startsWith("{")) {
+						raw = raw.substring(1, raw.length() - 1);
+						raw = raw.replace("=", ":");
+					}
+
 					if (!raw.contains("!")) {
 					if (!raw.contains("!")) {
 						String material = raw.split(":")[0];
 						String material = raw.split(":")[0];
 						if (Material.getMaterial(material.toUpperCase()) == null) {
 						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");
 					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(
 				plugin.sendConsole(String.format(
 						"&cConfig error: generator %s does not have a total chance of 100.0! Total chance is: %f", key,
 						"&cConfig error: generator %s does not have a total chance of 100.0! Total chance is: %f", key,
 						totalChance));
 						totalChance));