diff --git a/src/main/java/net/coreprotect/command/LookupCommand.java b/src/main/java/net/coreprotect/command/LookupCommand.java index 2668dc3..1eea2df 100755 --- a/src/main/java/net/coreprotect/command/LookupCommand.java +++ b/src/main/java/net/coreprotect/command/LookupCommand.java @@ -875,7 +875,7 @@ public class LookupCommand { int amount = Integer.parseInt(data[10]); String rbd = ((Integer.parseInt(data[8]) == 2 || Integer.parseInt(data[8]) == 3) ? Color.STRIKETHROUGH : ""); String timeago = Util.getTimeSince(Integer.parseInt(time), unixtimestamp, true); - Material blockType = Util.itemFilter(Util.getType(Integer.parseInt(dtype))); + Material blockType = Util.itemFilter(Util.getType(Integer.parseInt(dtype)), (Integer.parseInt(data[13]) == 0)); String dname = Util.nameFilter(blockType.name().toLowerCase(Locale.ROOT), ddata); String selector = Selector.FIRST; diff --git a/src/main/java/net/coreprotect/database/Lookup.java b/src/main/java/net/coreprotect/database/Lookup.java index 94b23fb..0ff551e 100755 --- a/src/main/java/net/coreprotect/database/Lookup.java +++ b/src/main/java/net/coreprotect/database/Lookup.java @@ -234,10 +234,8 @@ public class Lookup extends Queue { resultData = results.getInt("data"); resultAmount = results.getInt("amount"); resultMeta = results.getBytes("metadata"); - if (!lookup) { - resultTable = results.getInt("tbl"); - hasTbl = true; - } + resultTable = results.getInt("tbl"); + hasTbl = true; } else { resultData = results.getInt("data"); diff --git a/src/main/java/net/coreprotect/database/Rollback.java b/src/main/java/net/coreprotect/database/Rollback.java index 15c2dce..10dd2b6 100644 --- a/src/main/java/net/coreprotect/database/Rollback.java +++ b/src/main/java/net/coreprotect/database/Rollback.java @@ -1053,7 +1053,7 @@ public class Rollback extends Queue { int rolledBackInventory = Util.rolledBack((Integer) row[9], true); if (rowType != null) { if (inventoryRollback && ((rollbackType == 0 && rolledBackInventory == 0) || (rollbackType == 1 && rolledBackInventory == 1))) { - Material inventoryItem = Util.itemFilter(rowType); + Material inventoryItem = Util.itemFilter(rowType, ((Integer) row[14] == 0)); int rowUserId = (Integer) row[2]; String rowUser = ConfigHandler.playerIdCacheReversed.get(rowUserId); if (rowUser == null) { diff --git a/src/main/java/net/coreprotect/utility/Util.java b/src/main/java/net/coreprotect/utility/Util.java index a11d9f5..50a9829 100755 --- a/src/main/java/net/coreprotect/utility/Util.java +++ b/src/main/java/net/coreprotect/utility/Util.java @@ -1105,12 +1105,29 @@ public class Util extends Queue { Chat.sendComponent(consoleSender, Color.RESET + "[CoreProtect] " + string + Chat.COMPONENT_TAG_OPEN + Chat.COMPONENT_POPUP + "| | " + Chat.COMPONENT_TAG_CLOSE); } - public static Material itemFilter(Material material) { - if (material == null) { + // This filter is only used for a:inventory + public static Material itemFilter(Material material, boolean blockTable) { + if (material == null || (!blockTable && material.isItem())) { return material; } - if (!material.isItem() && material.name().contains("WALL_")) { + switch (material) { + case WHEAT: + material = Material.WHEAT_SEEDS; + break; + case PUMPKIN_STEM: + material = Material.PUMPKIN_SEEDS; + break; + case MELON_STEM: + material = Material.MELON_SEEDS; + break; + case BEETROOTS: + material = Material.BEETROOT_SEEDS; + break; + default: + } + + if (material.name().contains("WALL_")) { material = Material.valueOf(material.name().replace("WALL_", "")); }