mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-29 12:27:59 +01:00
Legacy data should look for legacy materials (Fixes #6618)
This commit is contained in:
parent
49fabba8b5
commit
3ce522545b
@ -0,0 +1,19 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Shane Freeder <theboyetronic@gmail.com>
|
||||
Date: Fri, 17 Sep 2021 09:26:06 +0100
|
||||
Subject: [PATCH] Legacy data should look for legacy materials
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||
@@ -0,0 +0,0 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, net.kyor
|
||||
|
||||
Material type;
|
||||
if (version < 0) {
|
||||
- type = Material.getMaterial(Material.LEGACY_PREFIX + (String) args.get("type"));
|
||||
+ type = Material.getMaterial(Material.LEGACY_PREFIX + (String) args.get("type"), true);
|
||||
|
||||
byte dataVal = (type != null && type.getMaxDurability() == 0) ? (byte) damage : 0; // Actually durable items get a 0 passed into conversion
|
||||
type = Bukkit.getUnsafe().fromLegacy(new MaterialData(type, dataVal), true);
|
Loading…
Reference in New Issue
Block a user