3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-15 12:30:06 +01:00

Switch around item conversion code as well

Dieser Commit ist enthalten in:
md_5 2018-08-11 20:19:12 +10:00
Ursprung 96778caabb
Commit a0a27e5876

Datei anzeigen

@ -109,6 +109,13 @@ public class CraftLegacy {
MaterialData materialData = new MaterialData(material, (byte) data); 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()) { if (material.isBlock()) {
// Try exact match first // Try exact match first
IBlockData converted = materialToData.get(materialData); 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 existing item
return item; return item;
} }