Updated Upstream (Paper)

Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@128691a Deprecate log4j logger method in `Plugin`
PaperMC/Paper@2a306f5 Add Multi Block Change API (#7333)
PaperMC/Paper@feb72b8 Update ASM EventExecutor generator patch to respect event handler return types. Fixes #7311 (#7317)
PaperMC/Paper@dcca6cb Make tag presets unmodifiable (#7378)
PaperMC/Paper@60e46ab Fix NotePlayEvent (#5180)
PaperMC/Paper@512995c Updated Upstream (Bukkit/CraftBukkit/Spigot) (#7359)
PaperMC/Paper@0a9602c [ci skip] Fix multiple ItemStack array nullability mistakes (#7055)
PaperMC/Paper@9a19308 Lock Frozen Ticks API (#7207)
PaperMC/Paper@a058ac0 Dolphin API (#7102)
PaperMC/Paper@f6c7d53 Add configurable stronghold seed (#7334)
PaperMC/Paper@7978121 More PotionEffectType API (#5737)
PaperMC/Paper@9490475 Add STRUCTURE_TYPE registry entry (#6400)
PaperMC/Paper@b164899 Update tiny-remapper
PaperMC/Paper@f7dbd06 [ci skip] Update parameter mappings
PaperMC/Paper@ca523ab [ci skip] Fix param mismatch from last commit
PaperMC/Paper@2e99e5e Updated Upstream (Bukkit/CraftBukkit) (#7411)
PaperMC/Paper@41263d9 [ci skip] Update paperweight to 1.3.4
PaperMC/Paper@3109dd8 Updated Upstream (Bukkit/CraftBukkit) (#7428)
PaperMC/Paper@17eb884 Use a CHM for StructureTemplate.Pallete cache
PaperMC/Paper@f79c0da Updated Upstream (Bukkit/CraftBukkit)
PaperMC/Paper@2121aed Rebuild patches
PaperMC/Paper@2ec04e0 Use correct headerLocation for regionfile initialisation
PaperMC/Paper@f23c039 Fix infinite recursion in spawnCategoryForChunk/Position
PaperMC/Paper@9940bca API for creating command sender which forwards feedback (#7432)
PaperMC/Paper@46ed080 fix portal linking in upgraded chunks (fixes #7419) (#7438)
PaperMC/Paper@6df4641 Use destination world when preloading spawn chunk (#7441)
PaperMC/Paper@0cc2503 Implement World#regenerateChunk (#7425)
PaperMC/Paper@00da098 Log exceptions thrown during chat processing (#7467)
PaperMC/Paper@26734e8 Updated Upstream (Bukkit/CraftBukkit/Spigot) (#7454)
PaperMC/Paper@4a745f9 Optimize Util#sequence (#7115)
PaperMC/Paper@2c8d48c Make Panda implement Sittable (#7414)
PaperMC/Paper@2c4a589 Fix issues with LimitedRegion (#7343)
PaperMC/Paper@3d91eca Fix cancelled snow bucket placement (#6751)
PaperMC/Paper@9567753 Don't load plugins prefixed with a dot (#7392)
PaperMC/Paper@92c777d Fix PlayerProfile BukkitObject serialization, deprecate setName and setId for removal (#7471)
PaperMC/Paper@e6898ff Fix IllegalArgumentException for /paper mobcaps command (#7472)
PaperMC/Paper@a8f2d67 - properly fix IllegalArgumentException in `/paper mobcaps` command
This commit is contained in:
lexikiq
2022-02-14 15:22:04 -05:00
parent 0234906175
commit e703b60287
13 changed files with 93 additions and 42 deletions

View File

@@ -6,10 +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 7cacc61fed0c610845c67894d1cc68e44f5e46fe..18feaf0152b67b18989ca03fbb74194db489081e 100644
index 9f72e1623fc85301c4ca8751a7e03877a7745948..4b5fdb42a72f0730553e5c5ff2819a6798a99ed8 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java
@@ -78,6 +78,7 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta {
@@ -83,12 +83,18 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta {
@Override
void serializeInternal(final Map<String, Tag> internalTags) {
if (this.profile != null) {
@@ -17,9 +17,8 @@ index 7cacc61fed0c610845c67894d1cc68e44f5e46fe..18feaf0152b67b18989ca03fbb74194d
internalTags.put(SKULL_PROFILE.NBT, serializedProfile);
}
}
@@ -91,6 +92,11 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta {
}
// Paper end
private void setProfile(GameProfile profile) {
this.profile = profile;
+ // Parchment start -- fix NPEs from plugins abusing NMS
+ refreshSerializedProfile();
@@ -29,7 +28,7 @@ index 7cacc61fed0c610845c67894d1cc68e44f5e46fe..18feaf0152b67b18989ca03fbb74194d
this.serializedProfile = (profile == null) ? null : NbtUtils.writeGameProfile(new CompoundTag(), profile);
}
@@ -99,6 +105,7 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta {
@@ -97,6 +103,7 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta {
super.applyToItem(tag);
if (this.profile != null) {
@@ -37,7 +36,7 @@ index 7cacc61fed0c610845c67894d1cc68e44f5e46fe..18feaf0152b67b18989ca03fbb74194d
// SPIGOT-6558: Set initial textures
tag.put(SKULL_OWNER.NBT, serializedProfile);
// Fill in textures
@@ -234,6 +241,8 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta {
@@ -252,6 +259,8 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta {
if (meta instanceof CraftMetaSkull) {
CraftMetaSkull that = (CraftMetaSkull) meta;