mirror of
https://github.com/EarthMC/QuickShop-Reremake.git
synced 2026-11-24 17:39:52 -05:00
1.4.3.1
Former-commit-id: 23b76443b8802cb63404975c690c895b86415eec [formerly 3270b3871189696877ba5398ff8c664e2e62f6e7] Former-commit-id: 8026b6d12347ec5d1b9b893bb95570a8b6a45ef7
This commit is contained in:
1 parent
789dc1c7f7
commit
d1acb080b9
3 files changed
+33
-30
No files matched your search
@@ -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");
|
||||
|
||||
@@ -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<Enchantment, Integer> ench1 = ((EnchantmentStorageMeta) stack1.getItemMeta()).getStoredEnchants();
|
||||
Map<Enchantment, Integer> 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<Enchantment, Integer> ench1 = ((EnchantmentStorageMeta) stack1.getItemMeta()).getStoredEnchants();
|
||||
// Map<Enchantment, Integer> 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;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user