mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-09 19:49:35 +01:00
Switch around item conversion code as well
By: md_5 <git@md-5.net>
This commit is contained in:
parent
c21a237a3f
commit
8a4ae7cde3
1 changed files with 7 additions and 6 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue