Upstream merge

This commit is contained in:
Thinkofdeath 2015-01-18 18:17:11 +00:00 committed by Zach Brown
parent 478838714f
commit 3c20eb4a97
2 changed files with 33 additions and 26 deletions

View File

@ -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 <md_5@live.com.au> From: md_5 <md_5@live.com.au>
Date: Sun, 2 Jun 2013 15:10:56 +1000 Date: Sun, 2 Jun 2013 15:10:56 +1000
Subject: [PATCH] Skeleton API Implementations Subject: [PATCH] Skeleton API Implementations
@ -124,12 +124,12 @@ index 6361b44..fed7b4d 100644
+ // Spigot end + // Spigot end
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java 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 --- 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
@@ -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 + // Spigot start
@ -192,5 +192,5 @@ index 5584353..8f5689f 100644
+ // Spigot end + // Spigot end
} }
-- --
2.1.0 1.9.5.msysgit.0

View File

@ -1,11 +1,11 @@
From ebd64189f0b5e134a0f159cf094d14ca4c2f1c45 Mon Sep 17 00:00:00 2001 From 0eaa3a328cc7659f59ae42d9625283bbf42b42b5 Mon Sep 17 00:00:00 2001
From: libraryaddict <redwarfare@live.com> From: libraryaddict <redwarfare@live.com>
Date: Fri, 22 Aug 2014 05:35:16 -0400 Date: Fri, 22 Aug 2014 05:35:16 -0400
Subject: [PATCH] Added isUnbreakable and setUnbreakable to ItemMeta 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 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 --- 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
@@ -207,6 +207,7 @@ class CraftMetaItem implements ItemMeta, Repairable { @@ -207,6 +207,7 @@ class CraftMetaItem implements ItemMeta, Repairable {
@ -51,10 +51,11 @@ index e011d85..0ee8280 100644
} }
static Map<Enchantment, Integer> buildEnchantments(Map<String, Object> map, ItemMetaKey key) { static Map<Enchantment, Integer> buildEnchantments(Map<String, Object> 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); applyEnchantments(enchantments, itemTag, ENCHANTMENTS);
+
+ // Spigot start + // Spigot start
+ if ( spigot.isUnbreakable() ) + if ( spigot.isUnbreakable() )
+ { + {
@ -62,10 +63,10 @@ index e011d85..0ee8280 100644
+ } + }
+ // Spigot end + // Spigot end
+ +
if (hasRepairCost()) { if (hasRepairCost()) {
itemTag.setInt(REPAIR.NBT, repairCost); itemTag.setInt(REPAIR.NBT, repairCost);
} @@ -570,7 +593,7 @@ class CraftMetaItem implements ItemMeta, Repairable {
@@ -570,7 +592,7 @@ class CraftMetaItem implements ItemMeta, Repairable {
@Overridden @Overridden
boolean isEmpty() { boolean isEmpty() {
@ -74,7 +75,7 @@ index e011d85..0ee8280 100644
} }
public String getDisplayName() { 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.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())
@ -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 + (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 + unhandledTags.hashCode();
+ hash = 61 * hash + (spigot.isUnbreakable() ? 1231 : 1237); // Spigot ++ hash = 61 * hash + (spigot.isUnbreakable() ? 1231 : 1237); // Spigot
return hash; 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); builder.put(REPAIR.BUKKIT, repairCost);
} }
+
+ // Spigot start + // Spigot start
+ if ( spigot.isUnbreakable() ) + if ( spigot.isUnbreakable() )
+ { + {
@ -103,18 +105,23 @@ index e011d85..0ee8280 100644
+ } + }
+ // Spigot end + // Spigot end
+ +
return builder; 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<String> 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 // Spigot start
private final Spigot spigot = new Spigot() private final Spigot spigot = new Spigot()
{ {
@ -135,5 +142,5 @@ index e011d85..0ee8280 100644
@Override @Override
-- --
2.1.0 1.9.5.msysgit.0