SPIGOT-5540: Adding items to inventory causes legacy-data loading
By: md_5 <git@md-5.net>
This commit is contained in:
parent
4b0f403a86
commit
0a8b3c8742
1 changed files with 3 additions and 3 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue