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

28 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: Sun, 13 Mar 2022 03:01:29 -0600
2022-07-28 03:57:50 +00:00
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
index deed77a3d44bc55681483d7f47f148b5220135f2..f927156d6d7b75ff9a1c437478ae3e200962398c 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
@@ -11,6 +11,7 @@ import net.minecraft.nbt.CompoundTag;
2022-07-28 03:57:50 +00:00
import net.minecraft.nbt.NbtUtils;
2022-12-27 01:58:16 +00:00
import net.minecraft.resources.ResourceLocation;
2022-07-28 03:57:50 +00:00
import net.minecraft.world.level.block.entity.SkullBlockEntity;
+import org.apache.commons.lang3.StringUtils; // Scissors
2022-07-28 03:57:50 +00:00
import org.bukkit.Bukkit;
import org.bukkit.Material;
2022-12-27 01:58:16 +00:00
import org.bukkit.NamespacedKey;
@@ -73,7 +74,7 @@ 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()) {
+ } else if (tag.contains(SKULL_OWNER.NBT, CraftMagicNumbers.NBT.TAG_STRING) && !StringUtils.isBlank(tag.getString(SKULL_OWNER.NBT))) { // Scissors
2022-07-28 03:57:50 +00:00
this.setProfile(new GameProfile(null, tag.getString(SKULL_OWNER.NBT)));
}
2022-12-27 01:58:16 +00:00