Update upstream

Dieser Commit ist enthalten in:
Aikar 2017-06-25 20:26:00 -04:00
Ursprung b3d6ec2d26
Commit 3244d917f3
3 geänderte Dateien mit 8 neuen und 31 gelöschten Zeilen

Datei anzeigen

@ -1,23 +0,0 @@
From 2234ffe16ceb4a94a8a90f850e59ff79dc8751a5 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sun, 25 Jun 2017 19:38:09 -0400
Subject: [PATCH] SPIGOT-3381: Alias SWEEPING to SWEEPING_EDGE
diff --git a/src/main/java/org/bukkit/enchantments/Enchantment.java b/src/main/java/org/bukkit/enchantments/Enchantment.java
index ac3a7f99..448fd8f8 100644
--- a/src/main/java/org/bukkit/enchantments/Enchantment.java
+++ b/src/main/java/org/bukkit/enchantments/Enchantment.java
@@ -325,6 +325,9 @@ public abstract class Enchantment {
* @return Resulting Enchantment, or null if not found
*/
public static Enchantment getByName(String name) {
+ if ("SWEEPING".equals(name)) {
+ name = "SWEEPING_EDGE";
+ }
return byName.get(name);
}
--
2.13.0

Datei anzeigen

@ -1,4 +1,4 @@
From 15898664587209c5044cc40622c9079734bbbb17 Mon Sep 17 00:00:00 2001
From ff28547573c85476ee8bbeec81798071b530501d Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Thu, 28 May 2015 23:00:19 -0400
Subject: [PATCH] Handle Item Meta Inconsistencies
@ -144,7 +144,7 @@ index 3f11e4279..ebb3e04bc 100644
static Map<Enchantment, Integer> getEnchantments(net.minecraft.server.ItemStack item) {
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
index 2bf7e9f35..523c14df0 100644
index 724da6772..935cbe867 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
@@ -6,13 +6,8 @@ import java.lang.annotation.RetentionPolicy;
@ -238,9 +238,9 @@ index 2bf7e9f35..523c14df0 100644
- Map<Enchantment, Integer> enchantments = new HashMap<Enchantment, Integer>(ench.size());
+ EnchantmentMap enchantments = new EnchantmentMap(); // Paper
for (Map.Entry<?, ?> entry : ench.entrySet()) {
Enchantment enchantment = Enchantment.getByName(entry.getKey().toString());
@@ -696,12 +699,12 @@ class CraftMetaItem implements ItemMeta, Repairable {
// Doctor older enchants
String enchantKey = entry.getKey().toString();
@@ -701,12 +704,12 @@ class CraftMetaItem implements ItemMeta, Repairable {
}
public Map<Enchantment, Integer> getEnchants() {
@ -255,7 +255,7 @@ index 2bf7e9f35..523c14df0 100644
}
if (ignoreRestrictions || level >= ench.getStartLevel() && level <= ench.getMaxLevel()) {
@@ -871,7 +874,7 @@ class CraftMetaItem implements ItemMeta, Repairable {
@@ -876,7 +879,7 @@ class CraftMetaItem implements ItemMeta, Repairable {
clone.lore = new ArrayList<String>(this.lore);
}
if (this.enchantments != null) {
@ -264,7 +264,7 @@ index 2bf7e9f35..523c14df0 100644
}
clone.hideFlag = this.hideFlag;
clone.unbreakable = this.unbreakable;
@@ -1029,6 +1032,23 @@ class CraftMetaItem implements ItemMeta, Repairable {
@@ -1034,6 +1037,23 @@ class CraftMetaItem implements ItemMeta, Repairable {
}
}

@ -1 +1 @@
Subproject commit d7cd7275f28ce2ace4dc2051e77a9c5ec80743f1
Subproject commit 9de5cb59a07a5539caf2a30073e4c734ad58019d