Use IProperty#getName when generating blockstate jsons (#6582)

Close #6520
This commit is contained in:
Edwin Mindcraft 2020-05-15 19:28:10 +02:00 committed by GitHub
parent c23ea1e733
commit 7fa42ca064
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -119,10 +119,10 @@ public final class MultiPartBlockStateBuilder implements IGeneratedBlockstate {
JsonObject when = new JsonObject(); JsonObject when = new JsonObject();
for (Entry<IProperty<?>, Collection<Comparable<?>>> e : conditions.asMap().entrySet()) { for (Entry<IProperty<?>, Collection<Comparable<?>>> e : conditions.asMap().entrySet()) {
StringBuilder activeString = new StringBuilder(); StringBuilder activeString = new StringBuilder();
for (Object val : e.getValue()) { for (Comparable<?> val : e.getValue()) {
if (activeString.length() > 0) if (activeString.length() > 0)
activeString.append("|"); activeString.append("|");
activeString.append(val.toString()); activeString.append(((IProperty) e.getKey()).getName(val));
} }
when.addProperty(e.getKey().getName(), activeString.toString()); when.addProperty(e.getKey().getName(), activeString.toString());
} }

View file

@ -307,7 +307,7 @@ public class VariantBlockStateBuilder implements IGeneratedBlockstate {
} }
ret.append(entry.getKey().getName()) ret.append(entry.getKey().getName())
.append('=') .append('=')
.append(entry.getValue()); .append(((IProperty) entry.getKey()).getName(entry.getValue()));
} }
return ret.toString(); return ret.toString();
} }