mirror of
https://github.com/songoda/FabledSkyBlock.git
synced 2024-11-23 10:45:54 +01:00
Update ItemStackUtil
This commit is contained in:
parent
d3ee17d037
commit
a41b7d27b4
@ -2,8 +2,10 @@ package com.songoda.skyblock.utils.item;
|
||||
|
||||
|
||||
import com.songoda.core.compatibility.CompatibleMaterial;
|
||||
import com.songoda.core.compatibility.ServerVersion;
|
||||
import com.songoda.skyblock.utils.version.NMSUtil;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import java.io.*;
|
||||
@ -25,9 +27,10 @@ public final class ItemStackUtil {
|
||||
.getMethod("a", DataInputStream.class).invoke(null, dataInputStream);
|
||||
Object craftItemStack;
|
||||
|
||||
if (NMSUtil.getVersionNumber() > 12) {
|
||||
assert NMSItemStackClass != null;
|
||||
if (ServerVersion.isServerVersionAtLeast(ServerVersion.V1_13)) {
|
||||
craftItemStack = NMSItemStackClass.getMethod("a", NBTTagCompoundClass).invoke(null, NBTTagCompound);
|
||||
} else if (NMSUtil.getVersionNumber() > 10) {
|
||||
} else if (ServerVersion.isServerVersionAtLeast(ServerVersion.V1_11)) {
|
||||
craftItemStack = NMSItemStackClass.getConstructor(NBTTagCompoundClass).newInstance(NBTTagCompound);
|
||||
} else {
|
||||
craftItemStack = NMSItemStackClass.getMethod("createStack", NBTTagCompoundClass).invoke(null,
|
||||
|
Loading…
Reference in New Issue
Block a user