- Added MFR support for 1.6.4

- Improved API for blocks
- NBT compound tags with non-identifier keys should now be output properly
This commit is contained in:
Stan Hebben committed 2014-08-09 12:06:26 +02:00
1 parent e644398505
commit e2b4f50dfc
97 files changed
+5307 -216

No files matched your search

@@ -137,7 +137,13 @@ public class DataMap implements IData {
} else {
result.append(", ");
}
result.append(entry.getKey());
if (isValidIdentifier(entry.getKey())) {
result.append(entry.getKey());
} else {
result.append("\"").append(entry.getKey()).append("\"");
}
result.append(": ");
result.append(entry.getValue().toString());
}
@@ -275,4 +281,16 @@ public class DataMap implements IData {
public String toString() {
return asString();
}
private boolean isValidIdentifier(String str) {
if (!Character.isJavaIdentifierStart(str.charAt(0)))
return false;
for (int i = 1; i < str.length(); i++) {
if (!Character.isJavaIdentifierPart(str.charAt(i)))
return false;
}
return true;
}
}