summaryrefslogtreecommitdiff
path: root/src/main/java/com/redstoner/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/redstoner/utils')
-rw-r--r--src/main/java/com/redstoner/utils/ItemProperties.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main/java/com/redstoner/utils/ItemProperties.java b/src/main/java/com/redstoner/utils/ItemProperties.java
index cddd0a4..dafb3ae 100644
--- a/src/main/java/com/redstoner/utils/ItemProperties.java
+++ b/src/main/java/com/redstoner/utils/ItemProperties.java
@@ -6,6 +6,7 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.function.BiConsumer;
+import org.bukkit.Material;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
@@ -19,6 +20,7 @@ import org.json.simple.parser.ParseException;
public class ItemProperties
{
private int id = 0;
+ private Material type;
private byte data = 0;
private int amount = 1;
private Map<Enchantment, Integer> enchantments;
@@ -34,7 +36,8 @@ public class ItemProperties
{
if (item == null)
return;
- id = item.getTypeId();
+ id = item.getType().getId();
+ type = item.getType();
data = item.getData().getData();
amount = item.getAmount();
enchantments = new HashMap<>();
@@ -59,7 +62,7 @@ public class ItemProperties
@SuppressWarnings("deprecation")
public ItemStack toItemStack()
{
- ItemStack result = new ItemStack(id, amount, data);
+ ItemStack result = new ItemStack(type, amount, data);
ItemMeta meta = result.getItemMeta();
if (meta == null)
return result;