From d1acb080b9601dd7c574280dbb697eeab1fd95c4 Mon Sep 17 00:00:00 2001 From: Ghost_chu <2908803755@qq.com> Date: Fri, 3 May 2019 14:04:07 +0800 Subject: [PATCH] 1.4.3.1 Former-commit-id: 23b76443b8802cb63404975c690c895b86415eec [formerly 3270b3871189696877ba5398ff8c664e2e62f6e7] Former-commit-id: 8026b6d12347ec5d1b9b893bb95570a8b6a45ef7 --- pom.xml | 2 +- .../org/maxgamer/quickshop/Util/Paste.java | 1 + .../org/maxgamer/quickshop/Util/Util.java | 60 ++++++++++--------- 3 files changed, 33 insertions(+), 30 deletions(-) diff --git a/pom.xml b/pom.xml index eb506167e..34a11cf47 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 org.maxgamer QuickShop - Reremake 1.4.3 + Reremake 1.4.3.1 diff --git a/src/main/java/org/maxgamer/quickshop/Util/Paste.java b/src/main/java/org/maxgamer/quickshop/Util/Paste.java index 0a8013e8d..c5979ece9 100644 --- a/src/main/java/org/maxgamer/quickshop/Util/Paste.java +++ b/src/main/java/org/maxgamer/quickshop/Util/Paste.java @@ -41,6 +41,7 @@ public class Paste { finalReport.append("\tCores: "+serverData.get("coreCount")+"\n"); finalReport.append("================================================\n"); finalReport.append("Server:\n"); + finalReport.append("\tBuild: "+Bukkit.getServer().getVersion()+"\n"); finalReport.append("\tJava: "+serverData.get("javaVersion")+"\n"); finalReport.append("\tPlayers: "+serverData.get("playerAmount")+"/"+ Bukkit.getOfflinePlayers().length+"\n"); finalReport.append("\tOnlineMode: "+serverData.get("onlineMode")+"\n"); diff --git a/src/main/java/org/maxgamer/quickshop/Util/Util.java b/src/main/java/org/maxgamer/quickshop/Util/Util.java index 6a398a2c5..717117aef 100644 --- a/src/main/java/org/maxgamer/quickshop/Util/Util.java +++ b/src/main/java/org/maxgamer/quickshop/Util/Util.java @@ -19,7 +19,6 @@ import org.bukkit.inventory.Inventory; import org.bukkit.inventory.InventoryHolder; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.Damageable; -import org.bukkit.inventory.meta.EnchantmentStorageMeta; import org.bukkit.inventory.meta.ItemMeta; import org.bukkit.inventory.meta.PotionMeta; import org.bukkit.potion.PotionEffect; @@ -473,35 +472,38 @@ public class Util { return false; // Not the same durability if (!stack1.getEnchantments().equals(stack2.getEnchantments())) return false; // They have the same enchants - if (stack1.getItemMeta().hasDisplayName() || stack2.getItemMeta().hasDisplayName()) { - if (stack1.getItemMeta().hasDisplayName() && stack2.getItemMeta().hasDisplayName()) { - if (!stack1.getItemMeta().getDisplayName().equals(stack2.getItemMeta().getDisplayName())) { - return false; // items have different display name - } - } else { - return false; // one of the item stacks have a display name - } - } - boolean book1 = stack1.getItemMeta() instanceof EnchantmentStorageMeta; - boolean book2 = stack2.getItemMeta() instanceof EnchantmentStorageMeta; - if (book1 != book2) - return false;// One has enchantment meta, the other does not. - if (book1 == true) { // They are the same here (both true or both - // false). So if one is true, the other is - // true. - Map ench1 = ((EnchantmentStorageMeta) stack1.getItemMeta()).getStoredEnchants(); - Map ench2 = ((EnchantmentStorageMeta) stack2.getItemMeta()).getStoredEnchants(); - if (!ench1.equals(ench2)) - return false; // Enchants aren't the same. - } - boolean potion1 = stack1.getItemMeta() instanceof PotionMeta; - boolean potion2 = stack2.getItemMeta() instanceof PotionMeta; - if (potion1 != potion2) + if(!stack1.getItemMeta().equals(stack2.getItemMeta())) return false; - if (potion1 == true) { - if (!((PotionMeta) stack1).equals(((PotionMeta) stack1))) - return false; - } +// if (stack1.getItemMeta().hasDisplayName() || stack2.getItemMeta().hasDisplayName()) { +// if (stack1.getItemMeta().hasDisplayName() && stack2.getItemMeta().hasDisplayName()) { +// if (!stack1.getItemMeta().getDisplayName().equals(stack2.getItemMeta().getDisplayName())) { +// return false; // items have different display name +// } +// } else { +// return false; // one of the item stacks have a display name +// } +// } +// boolean book1 = stack1.getItemMeta() instanceof EnchantmentStorageMeta; +// boolean book2 = stack2.getItemMeta() instanceof EnchantmentStorageMeta; +// if (book1 != book2) +// return false;// One has enchantment meta, the other does not. +// if (book1 == true) { // They are the same here (both true or both +// // false). So if one is true, the other is +// // true. +// Map ench1 = ((EnchantmentStorageMeta) stack1.getItemMeta()).getStoredEnchants(); +// Map ench2 = ((EnchantmentStorageMeta) stack2.getItemMeta()).getStoredEnchants(); +// if (!ench1.equals(ench2)) +// return false; // Enchants aren't the same. +// } +// boolean potion1 = stack1.getItemMeta() instanceof PotionMeta; +// boolean potion2 = stack2.getItemMeta() instanceof PotionMeta; +// if (potion1 != potion2) +// return false; +// if (potion1 == true) { +// if (!((PotionMeta) stack1).equals(((PotionMeta) stack1))) +// return false; +// } + return true; }