mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-11 02:02:04 -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
|
||||
*/
|
||||
public void setData(@Nullable MaterialData data) {
|
||||
Material mat = Bukkit.getUnsafe().toLegacy(getType());
|
||||
|
||||
if (data == null || mat == null || mat.getData() == null) {
|
||||
if (data == null) {
|
||||
this.data = data;
|
||||
} else {
|
||||
Material mat = Bukkit.getUnsafe().toLegacy(getType());
|
||||
|
||||
if ((data.getClass() == mat.getData()) || (data.getClass() == MaterialData.class)) {
|
||||
this.data = data;
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user