summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2018-08-11 17:43:31 +1000
committermd_5 <git@md-5.net>2018-08-11 17:43:31 +1000
commit1f85e52623dbf90e6d6f482660b34cb15f8f0f1b (patch)
tree54b27b43581cca5b4061689db76c825e8c40edf9 /src
parentc5ab54d8912abadb0426ca9acd701732aa4c6e33 (diff)
downloadbukkit-1f85e52623dbf90e6d6f482660b34cb15f8f0f1b.tar
bukkit-1f85e52623dbf90e6d6f482660b34cb15f8f0f1b.tar.gz
bukkit-1f85e52623dbf90e6d6f482660b34cb15f8f0f1b.tar.lz
bukkit-1f85e52623dbf90e6d6f482660b34cb15f8f0f1b.tar.xz
bukkit-1f85e52623dbf90e6d6f482660b34cb15f8f0f1b.zip
SPIGOT-4253: Add way to prioritise item conversion
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/bukkit/UnsafeValues.java2
-rw-r--r--src/main/java/org/bukkit/inventory/ItemStack.java2
2 files changed, 3 insertions, 1 deletions
diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java
index f1188b05..33cad901 100644
--- a/src/main/java/org/bukkit/UnsafeValues.java
+++ b/src/main/java/org/bukkit/UnsafeValues.java
@@ -23,6 +23,8 @@ public interface UnsafeValues {
Material fromLegacy(MaterialData material);
+ Material fromLegacy(MaterialData material, boolean itemPriority);
+
BlockData fromLegacy(Material material, byte data);
int getDataVersion();
diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java
index 3c91cbe6..89ab4725 100644
--- a/src/main/java/org/bukkit/inventory/ItemStack.java
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java
@@ -451,7 +451,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable {
type = Material.getMaterial(Material.LEGACY_PREFIX + (String) args.get("type"));
byte dataVal = (type.getMaxDurability() == 0) ? (byte) damage : 0; // Actually durable items get a 0 passed into conversion
- type = Bukkit.getUnsafe().fromLegacy(new MaterialData(type, dataVal));
+ type = Bukkit.getUnsafe().fromLegacy(new MaterialData(type, dataVal), true);
// We've converted now so the data val isn't a thing and can be reset
if (dataVal != 0) {