From 06faae935fb8adfa2aa2493b39433ee4d938730c Mon Sep 17 00:00:00 2001 From: md_5 Date: Sun, 15 Feb 2015 12:52:33 +1100 Subject: [PATCH] Fix merge conflicts. --- ...kable-and-setUnbreakable-to-ItemMeta.patch | 8 ++---- .../0127-Better-item-validation.patch | 4 +-- ...kable-and-setUnbreakable-to-ItemMeta.patch | 28 ++++++++++--------- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/Bukkit-Patches/0028-Added-isUnbreakable-and-setUnbreakable-to-ItemMeta.patch b/Bukkit-Patches/0028-Added-isUnbreakable-and-setUnbreakable-to-ItemMeta.patch index 6c912dd5fc..84529f7e4d 100644 --- a/Bukkit-Patches/0028-Added-isUnbreakable-and-setUnbreakable-to-ItemMeta.patch +++ b/Bukkit-Patches/0028-Added-isUnbreakable-and-setUnbreakable-to-ItemMeta.patch @@ -9,9 +9,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java +++ b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java @@ -0,0 +0,0 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable { - */ - boolean hasConflictingEnchant(Enchantment ench); + @SuppressWarnings("javadoc") + ItemMeta clone(); ++ + // Spigot start + public class Spigot + { @@ -39,8 +40,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + + Spigot spigot(); + // Spigot end -+ - @SuppressWarnings("javadoc") - ItemMeta clone(); } -- \ No newline at end of file diff --git a/CraftBukkit-Patches/0127-Better-item-validation.patch b/CraftBukkit-Patches/0127-Better-item-validation.patch index 0b9bd172a4..07a98007c8 100644 --- a/CraftBukkit-Patches/0127-Better-item-validation.patch +++ b/CraftBukkit-Patches/0127-Better-item-validation.patch @@ -105,8 +105,8 @@ diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -@@ -0,0 +0,0 @@ import com.google.common.collect.Sets; - import java.util.Arrays; +@@ -0,0 +0,0 @@ import java.util.EnumSet; + import java.util.HashSet; import java.util.Set; +// Spigot start diff --git a/CraftBukkit-Patches/0152-Added-isUnbreakable-and-setUnbreakable-to-ItemMeta.patch b/CraftBukkit-Patches/0152-Added-isUnbreakable-and-setUnbreakable-to-ItemMeta.patch index ea137ee82a..04172e3943 100644 --- a/CraftBukkit-Patches/0152-Added-isUnbreakable-and-setUnbreakable-to-ItemMeta.patch +++ b/CraftBukkit-Patches/0152-Added-isUnbreakable-and-setUnbreakable-to-ItemMeta.patch @@ -9,16 +9,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java @@ -0,0 +0,0 @@ class CraftMetaItem implements ItemMeta, Repairable { - static final ItemMetaKey ATTRIBUTES_UUID_HIGH = new ItemMetaKey("UUIDMost"); - @Specific(Specific.To.NBT) static final ItemMetaKey ATTRIBUTES_UUID_LOW = new ItemMetaKey("UUIDLeast"); + @Specific(Specific.To.NBT) + static final ItemMetaKey HIDEFLAGS = new ItemMetaKey("ItemFlags", "hideFlags"); ++ @Specific(Specific.To.NBT) + static final ItemMetaKey UNBREAKABLE = new ItemMetaKey("Unbreakable"); // Spigot private String displayName; private List lore; @@ -0,0 +0,0 @@ class CraftMetaItem implements ItemMeta, Repairable { - this.repairCost = meta.repairCost; this.attributes = meta.attributes; + this.hideFlag = meta.hideFlag; this.unhandledTags.putAll(meta.unhandledTags); + spigot.setUnbreakable( meta.spigot.isUnbreakable() ); // Spigot } @@ -38,9 +39,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 static Map buildEnchantments(NBTTagCompound tag, ItemMetaKey key) { @@ -0,0 +0,0 @@ class CraftMetaItem implements ItemMeta, Repairable { + } + } } - - attributes = null; ++ + // Spigot start + Boolean unbreakable = SerializableMeta.getObject( Boolean.class, map, UNBREAKABLE.BUKKIT, true ); + if ( unbreakable != null ) @@ -70,8 +72,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @Overridden boolean isEmpty() { -- return !(hasDisplayName() || hasEnchants() || hasLore() || hasAttributes() || hasRepairCost() || !unhandledTags.isEmpty()); -+ return !(hasDisplayName() || hasEnchants() || hasLore() || hasAttributes() || hasRepairCost() || !unhandledTags.isEmpty() || spigot.isUnbreakable()); // Spigot +- return !(hasDisplayName() || hasEnchants() || hasLore() || hasAttributes() || hasRepairCost() || !unhandledTags.isEmpty() || hideFlag != 0); ++ return !(hasDisplayName() || hasEnchants() || hasLore() || hasAttributes() || hasRepairCost() || !unhandledTags.isEmpty() || hideFlag != 0 || spigot.isUnbreakable()); // Spigot } public String getDisplayName() { @@ -79,16 +81,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 && (this.hasLore() ? that.hasLore() && this.lore.equals(that.lore) : !that.hasLore()) && (this.hasAttributes() ? that.hasAttributes() && this.attributes.equals(that.attributes) : !that.hasAttributes()) && (this.hasRepairCost() ? that.hasRepairCost() && this.repairCost == that.repairCost : !that.hasRepairCost()) -- && (this.unhandledTags.equals(that.unhandledTags)); -+ && (this.unhandledTags.equals(that.unhandledTags)) -+ && this.spigot.isUnbreakable() == that.spigot.isUnbreakable(); // Spigot +- && (this.hideFlag == that.hideFlag); ++ && (this.hideFlag == that.hideFlag) ++ && (this.spigot.isUnbreakable() == that.spigot.isUnbreakable()); // Spigot } /** @@ -0,0 +0,0 @@ class CraftMetaItem implements ItemMeta, Repairable { hash = 61 * hash + (hasAttributes() ? this.attributes.hashCode() : 0); hash = 61 * hash + (hasRepairCost() ? this.repairCost : 0); - hash = 61 * hash + unhandledTags.hashCode(); + hash = 61 * hash + hideFlag; + hash = 61 * hash + (spigot.isUnbreakable() ? 1231 : 1237); // Spigot return hash; } @@ -106,8 +108,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Spigot end + - return builder; - } + Set hideFlags = new HashSet(); + for (ItemFlag hideFlagEnum : getItemFlags()) { @@ -0,0 +0,0 @@ class CraftMetaItem implements ItemMeta, Repairable { synchronized (HANDLED_TAGS) { if (HANDLED_TAGS.isEmpty()) {