From dad51fc9005765dad13a503df4cbaea41bd4acb9 Mon Sep 17 00:00:00 2001 From: Intelli Date: Tue, 8 Mar 2022 08:42:06 -0700 Subject: [PATCH] Removed deprecated item durability and art ID method usage --- .../java/net/coreprotect/database/ContainerRollback.java | 2 +- src/main/java/net/coreprotect/database/Rollback.java | 4 ++-- .../net/coreprotect/database/logger/ContainerLogger.java | 2 +- src/main/java/net/coreprotect/utility/Util.java | 9 --------- 4 files changed, 4 insertions(+), 13 deletions(-) diff --git a/src/main/java/net/coreprotect/database/ContainerRollback.java b/src/main/java/net/coreprotect/database/ContainerRollback.java index 93b4ae1..14e1e7b 100644 --- a/src/main/java/net/coreprotect/database/ContainerRollback.java +++ b/src/main/java/net/coreprotect/database/ContainerRollback.java @@ -115,7 +115,7 @@ public class ContainerRollback extends Queue { action = 1; } - ItemStack itemstack = new ItemStack(rowType, rowAmount, (short) rowData); + ItemStack itemstack = new ItemStack(rowType, rowAmount); Object[] populatedStack = Rollback.populateItemStack(itemstack, rowMetadata); int slot = (Integer) populatedStack[0]; String faceData = (String) populatedStack[1]; diff --git a/src/main/java/net/coreprotect/database/Rollback.java b/src/main/java/net/coreprotect/database/Rollback.java index 3403fa5..8304a30 100644 --- a/src/main/java/net/coreprotect/database/Rollback.java +++ b/src/main/java/net/coreprotect/database/Rollback.java @@ -1091,7 +1091,7 @@ public class Rollback extends Queue { } int action = rollbackType == 0 ? (inventoryAction ^ 1) : inventoryAction; - ItemStack itemstack = new ItemStack(inventoryItem, rowAmount, (short) rowData); + ItemStack itemstack = new ItemStack(inventoryItem, rowAmount); Object[] populatedStack = populateItemStack(itemstack, rowMetadata); if (rowAction == ItemLogger.ITEM_REMOVE_ENDER || rowAction == ItemLogger.ITEM_ADD_ENDER) { modifyContainerItems(containerType, player.getEnderChest(), (Integer) populatedStack[0], ((ItemStack) populatedStack[2]).clone(), action ^ 1); @@ -1108,7 +1108,7 @@ public class Rollback extends Queue { } if ((rollbackType == 0 && rowRolledBack == 0) || (rollbackType == 1 && rowRolledBack == 1)) { - ItemStack itemstack = new ItemStack(rowType, rowAmount, (short) rowData); + ItemStack itemstack = new ItemStack(rowType, rowAmount); Object[] populatedStack = populateItemStack(itemstack, rowMetadata); String faceData = (String) populatedStack[1]; diff --git a/src/main/java/net/coreprotect/database/logger/ContainerLogger.java b/src/main/java/net/coreprotect/database/logger/ContainerLogger.java index 7523339..897c0a7 100644 --- a/src/main/java/net/coreprotect/database/logger/ContainerLogger.java +++ b/src/main/java/net/coreprotect/database/logger/ContainerLogger.java @@ -182,7 +182,7 @@ public class ContainerLogger extends Queue { int y = location.getBlockY(); int z = location.getBlockZ(); int typeId = Util.getBlockId(item.getType().name(), true); - int data = item.getDurability(); + int data = 0; int amount = item.getAmount(); ContainerStatement.insert(preparedStmt, batchCount, time, userId, wid, x, y, z, typeId, data, amount, metadata, action, 0); } diff --git a/src/main/java/net/coreprotect/utility/Util.java b/src/main/java/net/coreprotect/utility/Util.java index a198b46..35047c4 100755 --- a/src/main/java/net/coreprotect/utility/Util.java +++ b/src/main/java/net/coreprotect/utility/Util.java @@ -19,7 +19,6 @@ import java.util.Set; import java.util.SortedSet; import java.util.TreeSet; -import org.bukkit.Art; import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.Material; @@ -628,10 +627,6 @@ public class Util extends Queue { return false; } - public static int getArtId(Art art) { - return art.getId(); - } - public static int getArtId(String name, boolean internal) { int id = -1; name = name.toLowerCase(Locale.ROOT).trim(); @@ -1175,10 +1170,6 @@ public class Util extends Queue { return new ItemStack(type, amount); } - public static ItemStack newItemStack(Material type, int amount, short data) { - return new ItemStack(type, amount, data); - } - public static boolean isSpigot() { try { Class.forName("org.spigotmc.SpigotConfig");