summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2018-08-11 20:19:12 +1000
committermd_5 <git@md-5.net>2018-08-11 20:19:12 +1000
commita0a27e5876c97cc74158e7964d9a89805ac63a52 (patch)
tree0157ea45c0f9f183f5254457ccb1912fa3369b0e /src
parent96778caabb82eff6c2155d016bea938cebed3953 (diff)
downloadcraftbukkit-a0a27e5876c97cc74158e7964d9a89805ac63a52.tar
craftbukkit-a0a27e5876c97cc74158e7964d9a89805ac63a52.tar.gz
craftbukkit-a0a27e5876c97cc74158e7964d9a89805ac63a52.tar.lz
craftbukkit-a0a27e5876c97cc74158e7964d9a89805ac63a52.tar.xz
craftbukkit-a0a27e5876c97cc74158e7964d9a89805ac63a52.zip
Switch around item conversion code as well
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/bukkit/craftbukkit/util/CraftLegacy.java13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftLegacy.java b/src/main/java/org/bukkit/craftbukkit/util/CraftLegacy.java
index 15f24e9d..d98e0730 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftLegacy.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftLegacy.java
@@ -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;
}