Updated Upstream (Paper)

Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@c50fc3a Updated Upstream (Bukkit/CraftBukkit/Spigot) (#7480)
PaperMC/Paper@2a4aef3 Mark ChatRender#render as ApiStatus.Override
PaperMC/Paper@f5b9e07 Add GameEvent tags (#6439)
PaperMC/Paper@b173c3e Use access transformers for player profile API (#7468)
PaperMC/Paper@286bd1b 1.18 misc performance dev branch (#7368)
PaperMC/Paper@5bb4549 Fix entity armor not showing on death animation (#7355)
PaperMC/Paper@7b8e0c3 Updated Upstream (Bukkit/CraftBukkit)
PaperMC/Paper@36a1650 Furnace RecipesUsed API (#7399)
PaperMC/Paper@392acfd Configurable sculk sensor listener range (#6443)
PaperMC/Paper@b757019 Add missing block data mins and maxes (#6790)
PaperMC/Paper@9cab01e [ci skip] Update Gradle wrapper to 7.4
PaperMC/Paper@cdb893b Add mid-tick task execution to block ticking
PaperMC/Paper@854f3d3 Put world into worldlist before initing the world
PaperMC/Paper@db81163 Execute mid tick tasks during tile entity ticking
PaperMC/Paper@501834e Fix custom inventory holders (#6199)
PaperMC/Paper@04a337a Add some missing deprecations to the adventure patch (#7500)
PaperMC/Paper@b6dad9c Fix desync on teleporting entity on first tick (#7183)
PaperMC/Paper@2a55e35 Option to have default CustomSpawners in custom worlds (#7493)
PaperMC/Paper@bfa50ad Custom Potion Mixes (#6744)
PaperMC/Paper@7f65b0b Add DataConverter to StructureCheck, for structure lookups
PaperMC/Paper@30cb7d0 ignore excessive vel for Minecarts (Fixes #7515)
This commit is contained in:
lexikiq
2022-03-01 16:27:37 -05:00
parent e237cc3aa9
commit 9aa2e4da7e
9 changed files with 25 additions and 32 deletions

View File

@@ -6,17 +6,10 @@ Subject: [PATCH] Fix missing CraftMetaSkull serializedProfile
Plugins (ab)using NMS may change the "profile" field using reflections instead of the "setProfile" method, especially if they are targeted towards old Minecraft versions. This fixes the potential discrepancies and NPEs.
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java
index 9f72e1623fc85301c4ca8751a7e03877a7745948..4b5fdb42a72f0730553e5c5ff2819a6798a99ed8 100644
index 292ae4a68093b7d939a755e1062cee57da186ab1..4afa90cb68aa31820abce6ab051de405daef6562 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java
@@ -83,12 +83,18 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta {
@Override
void serializeInternal(final Map<String, Tag> internalTags) {
if (this.profile != null) {
+ refreshSerializedProfile(); // Parchment -- fix NPEs from plugins abusing NMS
internalTags.put(SKULL_PROFILE.NBT, serializedProfile);
}
}
@@ -80,6 +80,11 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta {
private void setProfile(GameProfile profile) {
this.profile = profile;
@@ -28,7 +21,7 @@ index 9f72e1623fc85301c4ca8751a7e03877a7745948..4b5fdb42a72f0730553e5c5ff2819a67
this.serializedProfile = (profile == null) ? null : NbtUtils.writeGameProfile(new CompoundTag(), profile);
}
@@ -97,6 +103,7 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta {
@@ -88,6 +93,7 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta {
super.applyToItem(tag);
if (this.profile != null) {
@@ -36,7 +29,7 @@ index 9f72e1623fc85301c4ca8751a7e03877a7745948..4b5fdb42a72f0730553e5c5ff2819a67
// SPIGOT-6558: Set initial textures
tag.put(SKULL_OWNER.NBT, serializedProfile);
// Fill in textures
@@ -252,6 +259,8 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta {
@@ -243,6 +249,8 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta {
if (meta instanceof CraftMetaSkull) {
CraftMetaSkull that = (CraftMetaSkull) meta;