prevent false material lookups when using compatibility

This commit is contained in:
jascotty2 2019-09-07 15:06:47 -05:00
parent c8c19cf088
commit 2b39836714

View File

@ -1022,15 +1022,17 @@ public enum LegacyMaterials {
private static final Map<String, LegacyMaterials> lookupMap = new HashMap();
static {
for (LegacyMaterials m : values()) {
lookupMap.put(m.name(), m);
lookupMap.put(m.material + ":" + (m.data == null ? "" : m.data), m);
}
for (LegacyMaterials m : values()) {
if (!lookupMap.containsKey(m.legacy)) {
lookupMap.put(m.legacy, m);
}
}
for (LegacyMaterials m : values()) {
lookupMap.put(m.name(), m);
if (!m.usesCompatibility()) {
lookupMap.put(m.material + ":" + (m.data == null ? "" : m.data), m);
}
}
for (LegacyMaterials m : values()) {
if (!m.usesCompatibility() && !lookupMap.containsKey(m.legacy)) {
lookupMap.put(m.legacy, m);
}
}
}
LegacyMaterials() {