From 3c20eb4a9796fac2071f112b26d77ee751725af2 Mon Sep 17 00:00:00 2001 From: Thinkofdeath Date: Sun, 18 Jan 2015 18:17:11 +0000 Subject: [PATCH] Upstream merge --- .../0003-Skeleton-API-Implementations.patch | 10 ++-- ...kable-and-setUnbreakable-to-ItemMeta.patch | 49 +++++++++++-------- 2 files changed, 33 insertions(+), 26 deletions(-) diff --git a/CraftBukkit-Patches/0003-Skeleton-API-Implementations.patch b/CraftBukkit-Patches/0003-Skeleton-API-Implementations.patch index e0bd6f3..1327a07 100644 --- a/CraftBukkit-Patches/0003-Skeleton-API-Implementations.patch +++ b/CraftBukkit-Patches/0003-Skeleton-API-Implementations.patch @@ -1,4 +1,4 @@ -From 4ab376f74dcf329d15853816a39474ca11e93961 Mon Sep 17 00:00:00 2001 +From 337e55ae0f39587d271afff1d4aa561bbb536816 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sun, 2 Jun 2013 15:10:56 +1000 Subject: [PATCH] Skeleton API Implementations @@ -124,12 +124,12 @@ index 6361b44..fed7b4d 100644 + // Spigot end } diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -index 7ebb70b..e80fce2 100644 +index 4681262..5d5cb92 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -@@ -713,4 +713,16 @@ class CraftMetaItem implements ItemMeta, Repairable { +@@ -715,4 +715,16 @@ class CraftMetaItem implements ItemMeta, Repairable { + return HANDLED_TAGS; } - return HANDLED_TAGS; } + + // Spigot start @@ -192,5 +192,5 @@ index 5584353..8f5689f 100644 + // Spigot end } -- -2.1.0 +1.9.5.msysgit.0 diff --git a/CraftBukkit-Patches/0153-Added-isUnbreakable-and-setUnbreakable-to-ItemMeta.patch b/CraftBukkit-Patches/0153-Added-isUnbreakable-and-setUnbreakable-to-ItemMeta.patch index 9fed030..cff7db7 100644 --- a/CraftBukkit-Patches/0153-Added-isUnbreakable-and-setUnbreakable-to-ItemMeta.patch +++ b/CraftBukkit-Patches/0153-Added-isUnbreakable-and-setUnbreakable-to-ItemMeta.patch @@ -1,11 +1,11 @@ -From ebd64189f0b5e134a0f159cf094d14ca4c2f1c45 Mon Sep 17 00:00:00 2001 +From 0eaa3a328cc7659f59ae42d9625283bbf42b42b5 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Fri, 22 Aug 2014 05:35:16 -0400 Subject: [PATCH] Added isUnbreakable and setUnbreakable to ItemMeta diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -index e011d85..0ee8280 100644 +index fef0971..64639b9 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java @@ -207,6 +207,7 @@ class CraftMetaItem implements ItemMeta, Repairable { @@ -51,10 +51,11 @@ index e011d85..0ee8280 100644 } static Map buildEnchantments(Map map, ItemMetaKey key) { -@@ -508,6 +523,13 @@ class CraftMetaItem implements ItemMeta, Repairable { +@@ -507,6 +522,14 @@ class CraftMetaItem implements ItemMeta, Repairable { + } applyEnchantments(enchantments, itemTag, ENCHANTMENTS); - ++ + // Spigot start + if ( spigot.isUnbreakable() ) + { @@ -62,10 +63,10 @@ index e011d85..0ee8280 100644 + } + // Spigot end + + if (hasRepairCost()) { itemTag.setInt(REPAIR.NBT, repairCost); - } -@@ -570,7 +592,7 @@ class CraftMetaItem implements ItemMeta, Repairable { +@@ -570,7 +593,7 @@ class CraftMetaItem implements ItemMeta, Repairable { @Overridden boolean isEmpty() { @@ -74,7 +75,7 @@ index e011d85..0ee8280 100644 } public String getDisplayName() { -@@ -695,7 +717,8 @@ class CraftMetaItem implements ItemMeta, Repairable { +@@ -695,7 +718,8 @@ class CraftMetaItem implements ItemMeta, Repairable { && (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()) @@ -84,18 +85,19 @@ index e011d85..0ee8280 100644 } /** -@@ -722,6 +745,7 @@ class CraftMetaItem implements ItemMeta, Repairable { +@@ -722,6 +746,7 @@ 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 + (spigot.isUnbreakable() ? 1231 : 1237); // Spigot +++ hash = 61 * hash + (spigot.isUnbreakable() ? 1231 : 1237); // Spigot return hash; } -@@ -765,6 +789,13 @@ class CraftMetaItem implements ItemMeta, Repairable { +@@ -764,6 +789,14 @@ class CraftMetaItem implements ItemMeta, Repairable { + if (hasRepairCost()) { builder.put(REPAIR.BUKKIT, repairCost); } - ++ + // Spigot start + if ( spigot.isUnbreakable() ) + { @@ -103,18 +105,23 @@ index e011d85..0ee8280 100644 + } + // Spigot end + + return builder; } +@@ -828,6 +861,7 @@ class CraftMetaItem implements ItemMeta, Repairable { + synchronized (HANDLED_TAGS) { + if (HANDLED_TAGS.isEmpty()) { + HANDLED_TAGS.addAll(Arrays.asList( ++ UNBREAKABLE.NBT, // Spigot + DISPLAY.NBT, + REPAIR.NBT, + ATTRIBUTES.NBT, +@@ -848,11 +882,23 @@ class CraftMetaItem implements ItemMeta, Repairable { + } + return HANDLED_TAGS; + } +- } -@@ -827,6 +858,7 @@ class CraftMetaItem implements ItemMeta, Repairable { - public static Set getHandledTags() { - if (HANDLED_TAGS.isEmpty()) { - HANDLED_TAGS.addAll(Arrays.asList( -+ UNBREAKABLE.NBT, // Spigot - DISPLAY.NBT, - REPAIR.NBT, - ATTRIBUTES.NBT, -@@ -851,6 +883,19 @@ class CraftMetaItem implements ItemMeta, Repairable { // Spigot start private final Spigot spigot = new Spigot() { @@ -135,5 +142,5 @@ index e011d85..0ee8280 100644 @Override -- -2.1.0 +1.9.5.msysgit.0