mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-11 10:12:06 -07:00
SPIGOT-5540: Adding items to inventory causes legacy-data loading
By: md_5 <git@md-5.net>
This commit is contained in:
@@ -184,11 +184,11 @@ public class ItemStack implements Cloneable, ConfigurationSerializable {
|
|||||||
* @param data New MaterialData for this item
|
* @param data New MaterialData for this item
|
||||||
*/
|
*/
|
||||||
public void setData(@Nullable MaterialData data) {
|
public void setData(@Nullable MaterialData data) {
|
||||||
Material mat = Bukkit.getUnsafe().toLegacy(getType());
|
if (data == null) {
|
||||||
|
|
||||||
if (data == null || mat == null || mat.getData() == null) {
|
|
||||||
this.data = data;
|
this.data = data;
|
||||||
} else {
|
} else {
|
||||||
|
Material mat = Bukkit.getUnsafe().toLegacy(getType());
|
||||||
|
|
||||||
if ((data.getClass() == mat.getData()) || (data.getClass() == MaterialData.class)) {
|
if ((data.getClass() == mat.getData()) || (data.getClass() == MaterialData.class)) {
|
||||||
this.data = data;
|
this.data = data;
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user