geforkt von Mirrors/Paper
[Auto] Updated Upstream (CraftBukkit)
Upstream has released updates that appears to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing
CraftBukkit Changes:
fc10dec5
Don't throw error on invalid data in CraftMetaItem.
Dieser Commit ist enthalten in:
Ursprung
003c0e0766
Commit
9787753c4f
@ -1,4 +1,4 @@
|
||||
From 30ade2c15c450c37075fac67b3a4893d44e61353 Mon Sep 17 00:00:00 2001
|
||||
From fe9f75e118fe7e2a336fbe522a55caf9ecdb5f74 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
|
||||
@ -18,7 +18,7 @@ For consistency, the old API methods now forward to use the
|
||||
ItemMeta API equivalents, and should deprecate the old API's.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java
|
||||
index 318c4204df..56787ed25c 100644
|
||||
index 318c4204d..56787ed25 100644
|
||||
--- a/src/main/java/net/minecraft/server/ItemStack.java
|
||||
+++ b/src/main/java/net/minecraft/server/ItemStack.java
|
||||
@@ -7,6 +7,8 @@ import com.mojang.brigadier.StringReader;
|
||||
@ -78,7 +78,7 @@ index 318c4204df..56787ed25c 100644
|
||||
|
||||
public boolean hasEnchantments() {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
|
||||
index 1d0580ff7f..2733cda407 100644
|
||||
index 1d0580ff7..2733cda40 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
|
||||
@@ -4,6 +4,7 @@ import static org.bukkit.craftbukkit.inventory.CraftMetaItem.ENCHANTMENTS;
|
||||
@ -201,7 +201,7 @@ index 1d0580ff7f..2733cda407 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 ae5daa5374..7c9c8d401a 100644
|
||||
index 99276f116..652866881 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
@@ -8,6 +8,7 @@ import java.lang.reflect.Constructor;
|
||||
@ -271,7 +271,7 @@ index ae5daa5374..7c9c8d401a 100644
|
||||
|
||||
for (int i = 0; i < ench.size(); i++) {
|
||||
String id = ((NBTTagCompound) ench.get(i)).getString(ENCHANTMENTS_ID.NBT);
|
||||
@@ -473,13 +476,13 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable {
|
||||
@@ -485,13 +488,13 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable {
|
||||
void deserializeInternal(NBTTagCompound tag, Object context) {
|
||||
}
|
||||
|
||||
@ -287,7 +287,7 @@ index ae5daa5374..7c9c8d401a 100644
|
||||
for (Map.Entry<?, ?> entry : ench.entrySet()) {
|
||||
// Doctor older enchants
|
||||
String enchantKey = entry.getKey().toString();
|
||||
@@ -700,13 +703,13 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable {
|
||||
@@ -716,13 +719,13 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable {
|
||||
}
|
||||
|
||||
public Map<Enchantment, Integer> getEnchants() {
|
||||
@ -303,7 +303,7 @@ index ae5daa5374..7c9c8d401a 100644
|
||||
}
|
||||
|
||||
if (ignoreRestrictions || level >= ench.getStartLevel() && level <= ench.getMaxLevel()) {
|
||||
@@ -1026,7 +1029,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable {
|
||||
@@ -1042,7 +1045,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable {
|
||||
clone.lore = new ArrayList<String>(this.lore);
|
||||
}
|
||||
if (this.enchantments != null) {
|
||||
@ -312,7 +312,7 @@ index ae5daa5374..7c9c8d401a 100644
|
||||
}
|
||||
if (this.hasAttributeModifiers()) {
|
||||
clone.attributeModifiers = HashMultimap.create(this.attributeModifiers);
|
||||
@@ -1227,6 +1230,23 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable {
|
||||
@@ -1243,6 +1246,23 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable {
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 528347621a6b1e6d07a0aeb890805990691b6167 Mon Sep 17 00:00:00 2001
|
||||
From f6c8bf4768c9cd63fe5525d97e8e44ef826b8833 Mon Sep 17 00:00:00 2001
|
||||
From: Zach Brown <zach.brown@destroystokyo.com>
|
||||
Date: Sat, 27 Jan 2018 17:04:14 -0500
|
||||
Subject: [PATCH] Add ArmorStand Item Meta
|
||||
@ -13,7 +13,7 @@ starting point for future additions in this area.
|
||||
Fixes GH-559
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
|
||||
index caaed7cf0b..2672b004db 100644
|
||||
index caaed7cf0..2672b004d 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
|
||||
@@ -191,6 +191,8 @@ public final class CraftItemFactory implements ItemFactory {
|
||||
@ -26,7 +26,7 @@ index caaed7cf0b..2672b004db 100644
|
||||
case CHEST:
|
||||
case TRAPPED_CHEST:
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
|
||||
index 2733cda407..e7daa95078 100644
|
||||
index 2733cda40..e7daa9507 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
|
||||
@@ -403,6 +403,8 @@ public final class CraftItemStack extends ItemStack {
|
||||
@ -40,7 +40,7 @@ index 2733cda407..e7daa95078 100644
|
||||
case TRAPPED_CHEST:
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaArmorStand.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaArmorStand.java
|
||||
new file mode 100644
|
||||
index 0000000000..0e8acf12e4
|
||||
index 000000000..0e8acf12e
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaArmorStand.java
|
||||
@@ -0,0 +1,309 @@
|
||||
@ -354,7 +354,7 @@ index 0000000000..0e8acf12e4
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
index 7c9c8d401a..b90a02ef6f 100644
|
||||
index 652866881..55afe8382 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
@@ -152,6 +152,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable {
|
||||
@ -365,7 +365,7 @@ index 7c9c8d401a..b90a02ef6f 100644
|
||||
.put(CraftMetaItem.class, "UNSPECIFIC")
|
||||
.build();
|
||||
|
||||
@@ -1223,7 +1224,15 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable {
|
||||
@@ -1239,7 +1240,15 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable {
|
||||
CraftMetaCharge.EXPLOSION.NBT,
|
||||
CraftMetaBlockState.BLOCK_ENTITY_TAG.NBT,
|
||||
CraftMetaKnowledgeBook.BOOK_RECIPES.NBT,
|
||||
@ -383,7 +383,7 @@ index 7c9c8d401a..b90a02ef6f 100644
|
||||
}
|
||||
return HANDLED_TAGS;
|
||||
diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java
|
||||
index 00f89f2296..ef9d40b8a0 100644
|
||||
index 00f89f229..ef9d40b8a 100644
|
||||
--- a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java
|
||||
+++ b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java
|
||||
@@ -6,6 +6,7 @@ import static org.hamcrest.Matchers.*;
|
||||
|
@ -1,11 +1,11 @@
|
||||
From fb168424520dbd77c3e78a2d2a5b1c369864a356 Mon Sep 17 00:00:00 2001
|
||||
From ffd4a2a4222744b839af420ca8d24eddac98dc9b Mon Sep 17 00:00:00 2001
|
||||
From: Mark Vainomaa <mikroskeem@mikroskeem.eu>
|
||||
Date: Wed, 12 Sep 2018 18:53:55 +0300
|
||||
Subject: [PATCH] Implement an API for CanPlaceOn and CanDestroy NBT values
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
index b90a02ef6f..c9d4d45564 100644
|
||||
index 55afe8382..d92811925 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
@@ -252,6 +252,12 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable {
|
||||
@ -67,7 +67,7 @@ index b90a02ef6f..c9d4d45564 100644
|
||||
|
||||
Set<String> keys = tag.getKeys();
|
||||
for (String key : keys) {
|
||||
@@ -567,6 +598,25 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable {
|
||||
@@ -579,6 +610,25 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable {
|
||||
if (hasDamage()) {
|
||||
itemTag.setInt(DAMAGE.NBT, damage);
|
||||
}
|
||||
@ -93,7 +93,7 @@ index b90a02ef6f..c9d4d45564 100644
|
||||
|
||||
for (Map.Entry<String, NBTBase> e : unhandledTags.entrySet()) {
|
||||
itemTag.set(e.getKey(), e.getValue());
|
||||
@@ -1231,7 +1281,9 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable {
|
||||
@@ -1247,7 +1297,9 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable {
|
||||
CraftMetaArmorStand.NO_BASE_PLATE.NBT,
|
||||
CraftMetaArmorStand.SHOW_ARMS.NBT,
|
||||
CraftMetaArmorStand.SMALL.NBT,
|
||||
@ -104,7 +104,7 @@ index b90a02ef6f..c9d4d45564 100644
|
||||
// Paper end
|
||||
));
|
||||
}
|
||||
@@ -1278,4 +1330,35 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable {
|
||||
@@ -1294,4 +1346,35 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable {
|
||||
return spigot;
|
||||
}
|
||||
// Spigot end
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 62f6c5bbeaf52d39e1009c1c024c1acac9f5926a Mon Sep 17 00:00:00 2001
|
||||
From 691b112b9931b505d5acb88a4ccdf7e994f03677 Mon Sep 17 00:00:00 2001
|
||||
From: Zach Brown <zach.brown@destroystokyo.com>
|
||||
Date: Sat, 22 Sep 2018 15:56:59 -0400
|
||||
Subject: [PATCH] Return null if we get a ParseException in IChatBaseComponent
|
||||
@ -16,7 +16,7 @@ Shulkers) may need to be changed in order for it to re-save properly
|
||||
No more crashing though.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/IChatBaseComponent.java b/src/main/java/net/minecraft/server/IChatBaseComponent.java
|
||||
index ff14b3e093..03c148f4f6 100644
|
||||
index ff14b3e09..03c148f4f 100644
|
||||
--- a/src/main/java/net/minecraft/server/IChatBaseComponent.java
|
||||
+++ b/src/main/java/net/minecraft/server/IChatBaseComponent.java
|
||||
@@ -357,7 +357,15 @@ public interface IChatBaseComponent extends Message, Iterable<IChatBaseComponent
|
@ -1,70 +0,0 @@
|
||||
From 5832e96cb9edff3b381bb51504a858329da67505 Mon Sep 17 00:00:00 2001
|
||||
From: Senmori <thesenmori@gmail.com>
|
||||
Date: Sat, 22 Sep 2018 12:55:43 -0400
|
||||
Subject: [PATCH] Spigot PR 493
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
index c9d4d45564..d928119254 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
@@ -423,22 +423,34 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable {
|
||||
continue;
|
||||
}
|
||||
net.minecraft.server.AttributeModifier nmsModifier = GenericAttributes.a(entry);
|
||||
- Preconditions.checkNotNull(nmsModifier, "Could not create AttributeModifier. %s", entry.toString());
|
||||
+ if (nmsModifier == null) {
|
||||
+ continue;
|
||||
+ }
|
||||
|
||||
AttributeModifier attribMod = CraftAttributeInstance.convert(nmsModifier);
|
||||
|
||||
String attributeName = entry.getString(ATTRIBUTES_IDENTIFIER.NBT);
|
||||
- Preconditions.checkArgument(!Strings.isNullOrEmpty(attributeName), "Missing Attribute for AttributeModifier. %s", entry.toString());
|
||||
+ if (attributeName == null || attributeName.isEmpty()) {
|
||||
+ continue;
|
||||
+ }
|
||||
|
||||
Attribute attribute = CraftAttributeMap.fromMinecraft(attributeName);
|
||||
- Preconditions.checkNotNull(attribute, "Could not convert to Bukkit Attribute. %s", attributeName);
|
||||
+ if (attribute == null) {
|
||||
+ continue;
|
||||
+ }
|
||||
|
||||
if (entry.hasKeyOfType(ATTRIBUTES_SLOT.NBT, CraftMagicNumbers.NBT.TAG_STRING)) {
|
||||
String slotName = entry.getString(ATTRIBUTES_SLOT.NBT);
|
||||
- Preconditions.checkArgument(!Strings.isNullOrEmpty(slotName), "Missing Slot when Slot is specified. %s", entry.toString());
|
||||
+ if (slotName == null || slotName.isEmpty()) {
|
||||
+ modifiers.put(attribute, attribMod);
|
||||
+ continue;
|
||||
+ }
|
||||
|
||||
EquipmentSlot slot = CraftEquipmentSlot.getSlot(EnumItemSlot.a(slotName.toLowerCase(Locale.ROOT))); // PAIL rename fromName
|
||||
- Preconditions.checkNotNull(slot, "No Slot found when Slot was specified. %s", entry.toString());
|
||||
+ if (slot == null) {
|
||||
+ modifiers.put(attribute, attribMod);
|
||||
+ continue;
|
||||
+ }
|
||||
|
||||
attribMod = new AttributeModifier(attribMod.getUniqueId(), attribMod.getName(), attribMod.getAmount(), attribMod.getOperation(), slot);
|
||||
}
|
||||
@@ -667,10 +679,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable {
|
||||
}
|
||||
net.minecraft.server.AttributeModifier nmsModifier = CraftAttributeInstance.convert(entry.getValue());
|
||||
NBTTagCompound sub = GenericAttributes.a(nmsModifier);
|
||||
- Preconditions.checkState(!sub.isEmpty(), "Could not convert AttributeModifier. It was supplied in an invalid format. The following was supplied: %s", sub.toString());
|
||||
+ if (sub.isEmpty()) {
|
||||
+ continue;
|
||||
+ }
|
||||
|
||||
String name = CraftAttributeMap.toMinecraft(entry.getKey());
|
||||
- Preconditions.checkArgument(!Strings.isNullOrEmpty(name), "Could not convert to Bukkit Attribute. %s", entry.getKey().name());
|
||||
+ if (name == null || name.isEmpty()) {
|
||||
+ continue;
|
||||
+ }
|
||||
|
||||
sub.setString(ATTRIBUTES_IDENTIFIER.NBT, name); // Attribute Name
|
||||
if (entry.getValue().getSlot() != null) {
|
||||
--
|
||||
2.19.0
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 65bb2d0f7d4d1581a11717784d8c6b6dc023fa91
|
||||
Subproject commit fc10dec5f369d71a5f0baad17b386ec9706b0773
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren