Scissors/patches/server/0005-Fixes-the-Blank-SkullOwner-exploit.patch

32 lines
1.6 KiB
Diff
Raw Normal View History

2022-07-28 03:57:50 +00:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Video <videogamesm12@gmail.com>
Date: Fri, 22 Apr 2022 00:59:00 -0500
Subject: [PATCH] Fixes the Blank SkullOwner exploit
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java
2022-09-13 06:41:21 +00:00
index 92b56f16b4d8107ccf206be6b81a98dc58986c10..e6d0cd263aa5769805426825df7e49724aa05809 100644
2022-07-28 03:57:50 +00:00
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java
2022-09-13 06:41:21 +00:00
@@ -9,6 +9,9 @@ import java.util.UUID;
2022-07-28 03:57:50 +00:00
import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.NbtUtils;
import net.minecraft.world.level.block.entity.SkullBlockEntity;
+// Scissors start
+import org.apache.commons.lang3.StringUtils;
+// Scissors end
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.OfflinePlayer;
2022-09-13 06:41:21 +00:00
@@ -61,7 +64,9 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta {
2022-07-28 03:57:50 +00:00
if (tag.contains(SKULL_OWNER.NBT, CraftMagicNumbers.NBT.TAG_COMPOUND)) {
this.setProfile(NbtUtils.readGameProfile(tag.getCompound(SKULL_OWNER.NBT)));
- } else if (tag.contains(SKULL_OWNER.NBT, CraftMagicNumbers.NBT.TAG_STRING) && !tag.getString(SKULL_OWNER.NBT).isEmpty()) {
+ // Scissors start
+ } else if (tag.contains(SKULL_OWNER.NBT, CraftMagicNumbers.NBT.TAG_STRING) && !StringUtils.isBlank(tag.getString(SKULL_OWNER.NBT))) {
+ // Scissors end
this.setProfile(new GameProfile(null, tag.getString(SKULL_OWNER.NBT)));
}
}