Added a isRecycled method.

This commit is contained in:
Brianna 2020-04-04 07:57:27 -04:00
parent 18e782b721
commit 6c8462282e

View File

@ -1034,7 +1034,11 @@ public enum CompatibleMaterial {
static {
for (CompatibleMaterial m : values()) {
lookupMap.put(m.name(), m);
if (m.isRecycled()) {
lookupMap.put(m.legacy, m);
continue;
}
lookupMap.put(m.name(), m);
if (!m.usesCompatibility()) {
lookupMap.put(m.material + ":" + (m.data == null ? "" : m.data), m);
}
@ -1160,6 +1164,15 @@ public enum CompatibleMaterial {
//return compatibleMaterial != null && ServerVersion.isServerVersionBelow(compatibleMaterial.versionLessThan);
}
/**
* Is this item reused in later versions of Minecraft?
*
* @return
*/
public boolean isRecycled() {
return usesLegacy() && this == CompatibleMaterial.GRASS;
}
/**
* Get the legacy data value for this material if there is one, or -1 if
* none