Updated Upstream (Bukkit/CraftBukkit)

Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
79e39671 SPIGOT-7034: Add methods for set/get instrument in Goat Horn

CraftBukkit Changes:
4768df736 SPIGOT-7034: Add methods for set/get instrument in Goat Horn
941d7e954 SPIGOT-7225: FireworkMeta#getPower() can throw a NullPointerException for items with no power set
This commit is contained in:
byquanton 2023-01-09 17:49:06 +01:00 committed by Shane Freeder
parent fb90721a94
commit 92c1a3e392
No known key found for this signature in database
GPG Key ID: A3F61EA5A085289C
18 changed files with 62 additions and 81 deletions

View File

@ -3903,10 +3903,10 @@ index 6a64fbb8b4937f39d5fdc2e2cbec26c83c74c486..7d6b5fdb00a5c1614849735634262a36
public String getTitle() {
return CraftChatMessage.fromComponent(this.container.getTitle());
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
index 4455bd0803327363bb76c52b4842a5cfe7f5ec90..8b01bed0d3f3b655783c3d53acf876d7eaf727c6 100644
index 9c5be190328a2bf79d7c02d8d3f38eea3771a534..102e3572424478375a2d175e4d5b6aacba8412a8 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
@@ -408,4 +408,17 @@ public final class CraftItemFactory implements ItemFactory {
@@ -410,4 +410,17 @@ public final class CraftItemFactory implements ItemFactory {
public Material updateMaterial(ItemMeta meta, Material material) throws IllegalArgumentException {
return ((CraftMetaItem) meta).updateMaterial(material);
}
@ -4178,10 +4178,10 @@ index 507fa96a3fb904b74429df5756c9a6378ec8c5b7..abb9e88abc74135284b941e040d40586
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
index f2737146ffb005dec43bd796043c53397a3b7485..0a5f063bc74e1dae67167537437ebd7e4ddf113a 100644
index 8ed06dc812fbda72667352fa42c03f9d9ae7ca7e..78029398774f1060e3522e4613259be894d68c22 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
@@ -746,6 +746,18 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@@ -747,6 +747,18 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
return !(this.hasDisplayName() || this.hasLocalizedName() || this.hasEnchants() || (this.lore != null) || this.hasCustomModelData() || this.hasBlockData() || this.hasRepairCost() || !this.unhandledTags.isEmpty() || !this.persistentDataContainer.isEmpty() || this.hideFlag != 0 || this.isUnbreakable() || this.hasDamage() || this.hasAttributeModifiers());
}
@ -4200,7 +4200,7 @@ index f2737146ffb005dec43bd796043c53397a3b7485..0a5f063bc74e1dae67167537437ebd7e
@Override
public String getDisplayName() {
return CraftChatMessage.fromJSONComponent(displayName);
@@ -781,6 +793,18 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@@ -782,6 +794,18 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
return this.lore != null && !this.lore.isEmpty();
}

View File

@ -70,7 +70,7 @@ index f53d8bb8078109f6ff89121261be46f1cccb2860..6ca9a5cf426befde4882d78df5fd8202
public boolean isEnchanted() {
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
index 416b6b3d78dec5a25a4ddb329552d03d1da183dd..be2e114ed21344c9336b920238d0ee575b8d342b 100644
index 781a1e5e4220d2198467c0fd3956f5e0387a7aff..3c3f5a4b7109ec8b47b550f9e766556f8d1546ec 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
@@ -6,7 +6,6 @@ import java.util.Map;
@ -184,7 +184,7 @@ index 416b6b3d78dec5a25a4ddb329552d03d1da183dd..be2e114ed21344c9336b920238d0ee57
static Map<Enchantment, Integer> getEnchantments(net.minecraft.world.item.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 0a5f063bc74e1dae67167537437ebd7e4ddf113a..4d687fa31f4d889ac755c178b9afd2b927c78ee2 100644
index 78029398774f1060e3522e4613259be894d68c22..9823ddae9edb40be805332ca1ef4325f9c1df14b 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
@@ -6,6 +6,7 @@ import com.google.common.collect.ImmutableList;
@ -211,7 +211,7 @@ index 0a5f063bc74e1dae67167537437ebd7e4ddf113a..4d687fa31f4d889ac755c178b9afd2b9
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.annotation.Nonnull;
@@ -272,7 +275,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@@ -273,7 +276,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
private List<String> lore; // null and empty are two different states internally
private Integer customModelData;
private CompoundTag blockData;
@ -220,7 +220,7 @@ index 0a5f063bc74e1dae67167537437ebd7e4ddf113a..4d687fa31f4d889ac755c178b9afd2b9
private Multimap<Attribute, AttributeModifier> attributeModifiers;
private int repairCost;
private int hideFlag;
@@ -283,7 +286,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@@ -284,7 +287,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
private static final CraftPersistentDataTypeRegistry DATA_TYPE_REGISTRY = new CraftPersistentDataTypeRegistry();
private CompoundTag internalTag;
@ -229,7 +229,7 @@ index 0a5f063bc74e1dae67167537437ebd7e4ddf113a..4d687fa31f4d889ac755c178b9afd2b9
private CraftPersistentDataContainer persistentDataContainer = new CraftPersistentDataContainer(CraftMetaItem.DATA_TYPE_REGISTRY);
private int version = CraftMagicNumbers.INSTANCE.getDataVersion(); // Internal use only
@@ -304,7 +307,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@@ -305,7 +308,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
this.blockData = meta.blockData;
if (meta.enchantments != null) { // Spigot
@ -238,7 +238,7 @@ index 0a5f063bc74e1dae67167537437ebd7e4ddf113a..4d687fa31f4d889ac755c178b9afd2b9
}
if (meta.hasAttributeModifiers()) {
@@ -387,13 +390,13 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@@ -388,13 +391,13 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
}
}
@ -254,7 +254,7 @@ index 0a5f063bc74e1dae67167537437ebd7e4ddf113a..4d687fa31f4d889ac755c178b9afd2b9
for (int i = 0; i < ench.size(); i++) {
String id = ((CompoundTag) ench.get(i)).getString(ENCHANTMENTS_ID.NBT);
@@ -546,13 +549,13 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@@ -547,13 +550,13 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
}
}
@ -270,7 +270,7 @@ index 0a5f063bc74e1dae67167537437ebd7e4ddf113a..4d687fa31f4d889ac755c178b9afd2b9
for (Map.Entry<?, ?> entry : ench.entrySet()) {
// Doctor older enchants
String enchantKey = entry.getKey().toString();
@@ -828,14 +831,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@@ -829,14 +832,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@Override
public Map<Enchantment, Integer> getEnchants() {
@ -287,7 +287,7 @@ index 0a5f063bc74e1dae67167537437ebd7e4ddf113a..4d687fa31f4d889ac755c178b9afd2b9
}
if (ignoreRestrictions || level >= ench.getStartLevel() && level <= ench.getMaxLevel()) {
@@ -1223,7 +1226,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@@ -1224,7 +1227,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
clone.customModelData = this.customModelData;
clone.blockData = this.blockData;
if (this.enchantments != null) {
@ -296,7 +296,7 @@ index 0a5f063bc74e1dae67167537437ebd7e4ddf113a..4d687fa31f4d889ac755c178b9afd2b9
}
if (this.hasAttributeModifiers()) {
clone.attributeModifiers = LinkedHashMultimap.create(this.attributeModifiers);
@@ -1458,4 +1461,22 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@@ -1460,4 +1463,22 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
return CraftMetaItem.HANDLED_TAGS;
}
}

View File

@ -7,10 +7,10 @@ This will take a Bukkit ItemStack and run it through any conversions a server pr
to ensure it meets latest minecraft expectations.
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
index 8b01bed0d3f3b655783c3d53acf876d7eaf727c6..8e36ab00122d0f23f0935ef69c3cc74b06d1b4a4 100644
index 102e3572424478375a2d175e4d5b6aacba8412a8..45d4a2951e0c4ab331b0e928451d0490b2df30c8 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
@@ -420,5 +420,11 @@ public final class CraftItemFactory implements ItemFactory {
@@ -422,5 +422,11 @@ public final class CraftItemFactory implements ItemFactory {
public net.kyori.adventure.text.@org.jetbrains.annotations.NotNull Component displayName(@org.jetbrains.annotations.NotNull ItemStack itemStack) {
return io.papermc.paper.adventure.PaperAdventure.asAdventure(CraftItemStack.asNMSCopy(itemStack).getDisplayName());
}

View File

@ -8,10 +8,10 @@ Currently the server only supports the English language. To override this,
You must replace the language file embedded in the server jar.
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
index 8e36ab00122d0f23f0935ef69c3cc74b06d1b4a4..b2344068802478861657ebcbc70f561544c64166 100644
index 45d4a2951e0c4ab331b0e928451d0490b2df30c8..42724d209b4fd5f246a2cedbc297ca2aa81fd5fe 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
@@ -426,5 +426,18 @@ public final class CraftItemFactory implements ItemFactory {
@@ -428,5 +428,18 @@ public final class CraftItemFactory implements ItemFactory {
public ItemStack ensureServerConversions(ItemStack item) {
return CraftItemStack.asCraftMirror(CraftItemStack.asNMSCopy(item));
}

View File

@ -255,10 +255,10 @@ index 4017933f2244fca32cf9d39444f3a4f550e8af01..e721517ce7b52a1aa10d039aa9f309eb
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
index 4d687fa31f4d889ac755c178b9afd2b927c78ee2..01ceb8de8411193fa407bf19bbd25a4bf44765d3 100644
index 9823ddae9edb40be805332ca1ef4325f9c1df14b..ecfd07e758b7121457df736803fcc5d09f902bc9 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
@@ -1452,6 +1452,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@@ -1453,6 +1453,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
CraftMetaCrossbow.CHARGED.NBT,
CraftMetaCrossbow.CHARGED_PROJECTILES.NBT,
CraftMetaSuspiciousStew.EFFECTS.NBT,
@ -274,10 +274,10 @@ index 4d687fa31f4d889ac755c178b9afd2b927c78ee2..01ceb8de8411193fa407bf19bbd25a4b
CraftMetaCompass.LODESTONE_POS.NBT,
CraftMetaCompass.LODESTONE_TRACKED.NBT,
diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java
index 851cacdae78b3772daca7fd05ff5f946dcfd3c2e..fe8bf637055f542151c4888b0fc8671d5b3cf67c 100644
index 79665967a2b2faf69d64a641d621d6d5afa7481a..a6887373240ec43d969b733d3182f2dc08faf46d 100644
--- a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java
+++ b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java
@@ -341,6 +341,7 @@ public class ItemMetaTest extends AbstractTestingBase {
@@ -342,6 +342,7 @@ public class ItemMetaTest extends AbstractTestingBase {
final CraftMetaArmorStand meta = (CraftMetaArmorStand) cleanStack.getItemMeta();
meta.entityTag = new CompoundTag();
meta.entityTag.putBoolean("Small", true);

View File

@ -11,10 +11,10 @@ Returns true if getDamage() == 0 or has damage tag or other tag is set.
Check the `ItemMetaTest#testTaggedButNotMeta` method to see how this method behaves.
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
index 846c89f7502b6f9a288b2fb7b6a7ba55b6fe1a38..7f6d331cf832f57857519b6e9801c3b45b53fc32 100644
index 8b3cc7b9ea8ef3ddd619bc4a6affb5bb38cad8c3..f3fcaf02a7718e20c1779934687a718e28a1d55a 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
@@ -622,7 +622,7 @@ public final class CraftItemStack extends ItemStack {
@@ -624,7 +624,7 @@ public final class CraftItemStack extends ItemStack {
@Override
public boolean hasItemMeta() {
@ -24,10 +24,10 @@ index 846c89f7502b6f9a288b2fb7b6a7ba55b6fe1a38..7f6d331cf832f57857519b6e9801c3b4
static boolean hasItemMeta(net.minecraft.world.item.ItemStack item) {
diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java
index fe8bf637055f542151c4888b0fc8671d5b3cf67c..7ce2782359be9aea3f2209138c3f82725b27515e 100644
index a6887373240ec43d969b733d3182f2dc08faf46d..bc5427e6e7221245330723c290dd15abf45ffdda 100644
--- a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java
+++ b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java
@@ -101,6 +101,34 @@ public class ItemMetaTest extends AbstractTestingBase {
@@ -102,6 +102,34 @@ public class ItemMetaTest extends AbstractTestingBase {
assertThat(itemMeta.hasConflictingEnchant(null), is(false));
}

View File

@ -5,7 +5,7 @@ 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 01ceb8de8411193fa407bf19bbd25a4bf44765d3..faa0d91713fb19820ca744f8c9449f79f44a55cb 100644
index ecfd07e758b7121457df736803fcc5d09f902bc9..90fa86ad21c7d671ea09145c8bd1c68dfaa14f2d 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
@@ -83,6 +83,12 @@ import org.bukkit.persistence.PersistentDataContainer;
@ -21,7 +21,7 @@ index 01ceb8de8411193fa407bf19bbd25a4bf44765d3..faa0d91713fb19820ca744f8c9449f79
/**
* Children must include the following:
*
@@ -268,6 +274,10 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@@ -269,6 +275,10 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@Specific(Specific.To.NBT)
static final ItemMetaKey BLOCK_DATA = new ItemMetaKey("BlockStateTag");
static final ItemMetaKey BUKKIT_CUSTOM_TAG = new ItemMetaKey("PublicBukkitValues");
@ -32,7 +32,7 @@ index 01ceb8de8411193fa407bf19bbd25a4bf44765d3..faa0d91713fb19820ca744f8c9449f79
// We store the raw original JSON representation of all text data. See SPIGOT-5063, SPIGOT-5656, SPIGOT-5304
private String displayName;
@@ -281,6 +291,10 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@@ -282,6 +292,10 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
private int hideFlag;
private boolean unbreakable;
private int damage;
@ -43,7 +43,7 @@ index 01ceb8de8411193fa407bf19bbd25a4bf44765d3..faa0d91713fb19820ca744f8c9449f79
private static final Set<String> HANDLED_TAGS = Sets.newHashSet();
private static final CraftPersistentDataTypeRegistry DATA_TYPE_REGISTRY = new CraftPersistentDataTypeRegistry();
@@ -318,6 +332,15 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@@ -319,6 +333,15 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
this.hideFlag = meta.hideFlag;
this.unbreakable = meta.unbreakable;
this.damage = meta.damage;
@ -59,7 +59,7 @@ index 01ceb8de8411193fa407bf19bbd25a4bf44765d3..faa0d91713fb19820ca744f8c9449f79
this.unhandledTags.putAll(meta.unhandledTags);
this.persistentDataContainer.putAll(meta.persistentDataContainer.getRaw());
@@ -381,6 +404,31 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@@ -382,6 +405,31 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
this.persistentDataContainer.put(key, compound.get(key).copy());
}
}
@ -91,7 +91,7 @@ index 01ceb8de8411193fa407bf19bbd25a4bf44765d3..faa0d91713fb19820ca744f8c9449f79
Set<String> keys = tag.getAllKeys();
for (String key : keys) {
@@ -519,6 +567,34 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@@ -520,6 +568,34 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
this.setDamage(damage);
}
@ -126,7 +126,7 @@ index 01ceb8de8411193fa407bf19bbd25a4bf44765d3..faa0d91713fb19820ca744f8c9449f79
String internal = SerializableMeta.getString(map, "internal", true);
if (internal != null) {
ByteArrayInputStream buf = new ByteArrayInputStream(Base64.getDecoder().decode(internal));
@@ -647,6 +723,23 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@@ -648,6 +724,23 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
if (this.hasDamage()) {
itemTag.putInt(DAMAGE.NBT, damage);
}
@ -150,7 +150,7 @@ index 01ceb8de8411193fa407bf19bbd25a4bf44765d3..faa0d91713fb19820ca744f8c9449f79
for (Map.Entry<String, Tag> e : this.unhandledTags.entrySet()) {
itemTag.put(e.getKey(), e.getValue());
@@ -663,6 +756,21 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@@ -664,6 +757,21 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
}
}
@ -172,7 +172,7 @@ index 01ceb8de8411193fa407bf19bbd25a4bf44765d3..faa0d91713fb19820ca744f8c9449f79
ListTag createStringList(List<String> list) {
if (list == null) {
return null;
@@ -746,7 +854,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@@ -747,7 +855,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@Overridden
boolean isEmpty() {
@ -181,7 +181,7 @@ index 01ceb8de8411193fa407bf19bbd25a4bf44765d3..faa0d91713fb19820ca744f8c9449f79
}
// Paper start
@@ -1177,7 +1285,11 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@@ -1178,7 +1286,11 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
&& (this.hideFlag == that.hideFlag)
&& (this.isUnbreakable() == that.isUnbreakable())
&& (this.hasDamage() ? that.hasDamage() && this.damage == that.damage : !that.hasDamage())
@ -194,7 +194,7 @@ index 01ceb8de8411193fa407bf19bbd25a4bf44765d3..faa0d91713fb19820ca744f8c9449f79
}
/**
@@ -1212,6 +1324,10 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@@ -1213,6 +1325,10 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
hash = 61 * hash + (this.hasDamage() ? this.damage : 0);
hash = 61 * hash + (this.hasAttributeModifiers() ? this.attributeModifiers.hashCode() : 0);
hash = 61 * hash + this.version;
@ -205,7 +205,7 @@ index 01ceb8de8411193fa407bf19bbd25a4bf44765d3..faa0d91713fb19820ca744f8c9449f79
return hash;
}
@@ -1236,6 +1352,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@@ -1237,6 +1353,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
clone.unbreakable = this.unbreakable;
clone.damage = this.damage;
clone.version = this.version;
@ -220,7 +220,7 @@ index 01ceb8de8411193fa407bf19bbd25a4bf44765d3..faa0d91713fb19820ca744f8c9449f79
return clone;
} catch (CloneNotSupportedException e) {
throw new Error(e);
@@ -1293,6 +1417,23 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@@ -1294,6 +1418,23 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
builder.put(DAMAGE.BUKKIT, damage);
}
@ -244,7 +244,7 @@ index 01ceb8de8411193fa407bf19bbd25a4bf44765d3..faa0d91713fb19820ca744f8c9449f79
final Map<String, Tag> internalTags = new HashMap<String, Tag>(this.unhandledTags);
this.serializeInternal(internalTags);
if (!internalTags.isEmpty()) {
@@ -1459,6 +1600,8 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@@ -1460,6 +1601,8 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
CraftMetaArmorStand.SHOW_ARMS.NBT,
CraftMetaArmorStand.SMALL.NBT,
CraftMetaArmorStand.MARKER.NBT,
@ -253,7 +253,7 @@ index 01ceb8de8411193fa407bf19bbd25a4bf44765d3..faa0d91713fb19820ca744f8c9449f79
// Paper end
CraftMetaCompass.LODESTONE_DIMENSION.NBT,
CraftMetaCompass.LODESTONE_POS.NBT,
@@ -1487,4 +1630,146 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@@ -1489,4 +1632,146 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
}
// Paper end

View File

@ -30,10 +30,10 @@ index fac4097be2ee3d0bffbc92fb217f98831e78d6b3..233e372ba5d785352c9ac12dac37395b
public CraftAttributeMap(AttributeMap handle) {
this.handle = handle;
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
index faa0d91713fb19820ca744f8c9449f79f44a55cb..d83ac28bd9147e33a838cf6250070fa0841f74b2 100644
index 90fa86ad21c7d671ea09145c8bd1c68dfaa14f2d..0b76155d77d048338c62651ab150d281c9cb795a 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
@@ -480,7 +480,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@@ -481,7 +481,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
AttributeModifier attribMod = CraftAttributeInstance.convert(nmsModifier);

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Support components in ItemMeta
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
index d83ac28bd9147e33a838cf6250070fa0841f74b2..71434a6778ab85e347d33a7c35cba7c0d7830d1e 100644
index 0b76155d77d048338c62651ab150d281c9cb795a..0187d1aa196d358febd07633a3cb71845ea99698 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
@@ -874,11 +874,23 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@@ -875,11 +875,23 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
return CraftChatMessage.fromJSONComponent(displayName);
}
@ -32,7 +32,7 @@ index d83ac28bd9147e33a838cf6250070fa0841f74b2..71434a6778ab85e347d33a7c35cba7c0
@Override
public boolean hasDisplayName() {
return this.displayName != null;
@@ -1021,6 +1033,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@@ -1022,6 +1034,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
return this.lore == null ? null : new ArrayList<String>(Lists.transform(this.lore, CraftChatMessage::fromJSONComponent));
}
@ -47,7 +47,7 @@ index d83ac28bd9147e33a838cf6250070fa0841f74b2..71434a6778ab85e347d33a7c35cba7c0
@Override
public void setLore(List<String> lore) {
if (lore == null || lore.isEmpty()) {
@@ -1035,6 +1055,21 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@@ -1036,6 +1056,21 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
}
}
@ -69,7 +69,7 @@ index d83ac28bd9147e33a838cf6250070fa0841f74b2..71434a6778ab85e347d33a7c35cba7c0
@Override
public boolean hasCustomModelData() {
return this.customModelData != null;
@@ -1502,6 +1537,11 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@@ -1503,6 +1538,11 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
}
for (Object object : addFrom) {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Create HoverEvent from ItemStack Entity
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
index b2344068802478861657ebcbc70f561544c64166..6da68728ead8eeb986baeb8bb0a3503307f5b70b 100644
index 42724d209b4fd5f246a2cedbc297ca2aa81fd5fe..e3bedba23bc57a51e8e702a9a6ab89db8700263c 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
@@ -439,5 +439,40 @@ public final class CraftItemFactory implements ItemFactory {
@@ -441,5 +441,40 @@ public final class CraftItemFactory implements ItemFactory {
return nms != null ? net.minecraft.locale.Language.getInstance().getOrDefault(nms.getItem().getDescriptionId(nms)) : null;
}

View File

@ -32,10 +32,10 @@ index e8413ad360e9b6c4eef13edf9dd0095e7e64bce2..a5d7fae348b0b262a0a8a5e8e76f1bc7
}
}
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
index 71434a6778ab85e347d33a7c35cba7c0d7830d1e..f31add9c60a18bbcea9b4944b0ab183acae84cab 100644
index 0187d1aa196d358febd07633a3cb71845ea99698..34f27913dc80915135bb476447dcbff9b32e302c 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
@@ -357,7 +357,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@@ -358,7 +358,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
CompoundTag display = tag.getCompound(DISPLAY.NBT);
if (display.contains(NAME.NBT)) {
@ -44,7 +44,7 @@ index 71434a6778ab85e347d33a7c35cba7c0d7830d1e..f31add9c60a18bbcea9b4944b0ab183a
}
if (display.contains(LOCNAME.NBT)) {
@@ -368,7 +368,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@@ -369,7 +369,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
ListTag list = display.getList(LORE.NBT, CraftMagicNumbers.NBT.TAG_STRING);
this.lore = new ArrayList<String>(list.size());
for (int index = 0; index < list.size(); index++) {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Add ItemFactory#getSpawnEgg API
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
index 6da68728ead8eeb986baeb8bb0a3503307f5b70b..a7370f440dbcde6bf56deb1c1763baaa2a30da88 100644
index e3bedba23bc57a51e8e702a9a6ab89db8700263c..a1a4640fc909aa0a261b78355ce8ab54ec70caac 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
@@ -474,5 +474,17 @@ public final class CraftItemFactory implements ItemFactory {
@@ -476,5 +476,17 @@ public final class CraftItemFactory implements ItemFactory {
entity.getUniqueId().toString(),
new net.md_5.bungee.api.chat.TextComponent(customName));
}

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Implement enchantWithLevels API
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
index a7370f440dbcde6bf56deb1c1763baaa2a30da88..9076770aa8dc9a7a40efc06bb9fc50fd85026188 100644
index a1a4640fc909aa0a261b78355ce8ab54ec70caac..f8d7e13c6ea7f2bc19d1d30bb82c54a4daeca45f 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
@@ -410,6 +410,21 @@ public final class CraftItemFactory implements ItemFactory {
@@ -412,6 +412,21 @@ public final class CraftItemFactory implements ItemFactory {
}
// Paper start

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Fix NPE for BlockDataMeta#getBlockData
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
index f31add9c60a18bbcea9b4944b0ab183acae84cab..90d7e8415f158c3176a705749f0aa36a729d3b38 100644
index 34f27913dc80915135bb476447dcbff9b32e302c..58c1d07f41fc382b23df17739090f5031fd41aad 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
@@ -1093,7 +1093,10 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@@ -1094,7 +1094,10 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@Override
public BlockData getBlockData(Material material) {

View File

@ -1,19 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Owen1212055 <23108066+Owen1212055@users.noreply.github.com>
Date: Thu, 29 Dec 2022 11:16:05 -0500
Subject: [PATCH] Return 0 by default for FireworkMeta
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaFirework.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaFirework.java
index 907b016d3d7b4c756fa0ca75fb92d86b2e9bde1c..66e8863c0e60771719b8cf4f54a4e362943d7a42 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaFirework.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaFirework.java
@@ -389,7 +389,7 @@ class CraftMetaFirework extends CraftMetaItem implements FireworkMeta {
@Override
public int getPower() {
- return this.power;
+ return java.util.Objects.requireNonNullElse(this.power, 0); // Paper
}
@Override

@ -1 +1 @@
Subproject commit d352d96500fbd215d06f4561f374faabb1c0b1fd
Subproject commit 79e3967192566bce29eb6688fc3abafa69a2be24

@ -1 +1 @@
Subproject commit 397c5557cac66a242573cec11a2966d812b710d2
Subproject commit 4768df7366ef10e808b31e8b167b21913822f076