Switch around item conversion code as well

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot 2018-08-11 20:19:12 +10:00
parent c21a237a3f
commit 8a4ae7cde3

View file

@ -109,6 +109,13 @@ public class CraftLegacy {
MaterialData materialData = new MaterialData(material, (byte) data);
// First try matching item
Item convertedItem = materialToItem.get(materialData);
if (convertedItem != null) {
return convertedItem;
}
// Fallback to matching block
if (material.isBlock()) {
// Try exact match first
IBlockData converted = materialToData.get(materialData);
@ -123,12 +130,6 @@ public class CraftLegacy {
}
}
// Fallback to matching item
Item convertedItem = materialToItem.get(materialData);
if (convertedItem != null) {
return convertedItem;
}
// Return existing item
return item;
}