Fix merge conflicts.

This commit is contained in:
md_5
2015-02-15 12:52:33 +11:00
parent 00c4207874
commit 06faae935f
3 changed files with 20 additions and 20 deletions

View File

@@ -9,9 +9,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java --- a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
+++ b/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 { @@ -0,0 +0,0 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable {
*/
boolean hasConflictingEnchant(Enchantment ench);
@SuppressWarnings("javadoc")
ItemMeta clone();
+
+ // Spigot start + // Spigot start
+ public class Spigot + public class Spigot
+ { + {
@@ -39,8 +40,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ +
+ Spigot spigot(); + Spigot spigot();
+ // Spigot end + // Spigot end
+
@SuppressWarnings("javadoc")
ItemMeta clone();
} }
-- --

View File

@@ -105,8 +105,8 @@ diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
+++ b/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; @@ -0,0 +0,0 @@ import java.util.EnumSet;
import java.util.Arrays; import java.util.HashSet;
import java.util.Set; import java.util.Set;
+// Spigot start +// Spigot start

View File

@@ -9,16 +9,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
+++ b/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 { @@ -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"); 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 + static final ItemMetaKey UNBREAKABLE = new ItemMetaKey("Unbreakable"); // Spigot
private String displayName; private String displayName;
private List<String> lore; private List<String> lore;
@@ -0,0 +0,0 @@ class CraftMetaItem implements ItemMeta, Repairable { @@ -0,0 +0,0 @@ class CraftMetaItem implements ItemMeta, Repairable {
this.repairCost = meta.repairCost;
this.attributes = meta.attributes; this.attributes = meta.attributes;
this.hideFlag = meta.hideFlag;
this.unhandledTags.putAll(meta.unhandledTags); this.unhandledTags.putAll(meta.unhandledTags);
+ spigot.setUnbreakable( meta.spigot.isUnbreakable() ); // Spigot + spigot.setUnbreakable( meta.spigot.isUnbreakable() ); // Spigot
} }
@@ -38,9 +39,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
static Map<Enchantment, Integer> buildEnchantments(NBTTagCompound tag, ItemMetaKey key) { static Map<Enchantment, Integer> buildEnchantments(NBTTagCompound tag, ItemMetaKey key) {
@@ -0,0 +0,0 @@ class CraftMetaItem implements ItemMeta, Repairable { @@ -0,0 +0,0 @@ class CraftMetaItem implements ItemMeta, Repairable {
}
}
} }
+
attributes = null;
+ // Spigot start + // Spigot start
+ Boolean unbreakable = SerializableMeta.getObject( Boolean.class, map, UNBREAKABLE.BUKKIT, true ); + Boolean unbreakable = SerializableMeta.getObject( Boolean.class, map, UNBREAKABLE.BUKKIT, true );
+ if ( unbreakable != null ) + if ( unbreakable != null )
@@ -70,8 +72,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@Overridden @Overridden
boolean isEmpty() { boolean isEmpty() {
- return !(hasDisplayName() || hasEnchants() || hasLore() || hasAttributes() || hasRepairCost() || !unhandledTags.isEmpty()); - return !(hasDisplayName() || hasEnchants() || hasLore() || hasAttributes() || hasRepairCost() || !unhandledTags.isEmpty() || hideFlag != 0);
+ return !(hasDisplayName() || hasEnchants() || hasLore() || hasAttributes() || hasRepairCost() || !unhandledTags.isEmpty() || spigot.isUnbreakable()); // Spigot + return !(hasDisplayName() || hasEnchants() || hasLore() || hasAttributes() || hasRepairCost() || !unhandledTags.isEmpty() || hideFlag != 0 || spigot.isUnbreakable()); // Spigot
} }
public String getDisplayName() { public String getDisplayName() {
@@ -79,16 +81,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
&& (this.hasLore() ? that.hasLore() && this.lore.equals(that.lore) : !that.hasLore()) && (this.hasLore() ? that.hasLore() && this.lore.equals(that.lore) : !that.hasLore())
&& (this.hasAttributes() ? that.hasAttributes() && this.attributes.equals(that.attributes) : !that.hasAttributes()) && (this.hasAttributes() ? that.hasAttributes() && this.attributes.equals(that.attributes) : !that.hasAttributes())
&& (this.hasRepairCost() ? that.hasRepairCost() && this.repairCost == that.repairCost : !that.hasRepairCost()) && (this.hasRepairCost() ? that.hasRepairCost() && this.repairCost == that.repairCost : !that.hasRepairCost())
- && (this.unhandledTags.equals(that.unhandledTags)); - && (this.hideFlag == that.hideFlag);
+ && (this.unhandledTags.equals(that.unhandledTags)) + && (this.hideFlag == that.hideFlag)
+ && this.spigot.isUnbreakable() == that.spigot.isUnbreakable(); // Spigot + && (this.spigot.isUnbreakable() == that.spigot.isUnbreakable()); // Spigot
} }
/** /**
@@ -0,0 +0,0 @@ class CraftMetaItem implements ItemMeta, Repairable { @@ -0,0 +0,0 @@ class CraftMetaItem implements ItemMeta, Repairable {
hash = 61 * hash + (hasAttributes() ? this.attributes.hashCode() : 0); hash = 61 * hash + (hasAttributes() ? this.attributes.hashCode() : 0);
hash = 61 * hash + (hasRepairCost() ? this.repairCost : 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 + hash = 61 * hash + (spigot.isUnbreakable() ? 1231 : 1237); // Spigot
return hash; return hash;
} }
@@ -106,8 +108,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Spigot end + // Spigot end
+ +
return builder; Set<String> hideFlags = new HashSet<String>();
} for (ItemFlag hideFlagEnum : getItemFlags()) {
@@ -0,0 +0,0 @@ class CraftMetaItem implements ItemMeta, Repairable { @@ -0,0 +0,0 @@ class CraftMetaItem implements ItemMeta, Repairable {
synchronized (HANDLED_TAGS) { synchronized (HANDLED_TAGS) {
if (HANDLED_TAGS.isEmpty()) { if (HANDLED_TAGS.isEmpty()) {