summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Panić <david@panic.tk>2018-12-15 21:32:11 +0100
committerDavid Panić <david@panic.tk>2018-12-15 21:32:11 +0100
commit8bcb01366090236478f04c69c98c1b8f365919ac (patch)
tree77db1fbf8cafc67bcbdb08a5fa7e0a55f2b5e0b7
parente564fef43f02cd1f0d20d3d632e17576d6f94797 (diff)
Updated ItemProperties (utils) to 1.13
-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;