mirror of
https://github.com/AtlasMediaGroup/Scissors.git
synced 2024-11-18 03:06:11 +00:00
41e0723e0e
* First pass * Second pass * Limit string tag visitors to 1024 elements * Split configuration patch into multiple patches * Third and final pass * Fix build error
28 lines
1.6 KiB
Diff
28 lines
1.6 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Video <videogamesm12@gmail.com>
|
|
Date: Sun, 13 Mar 2022 03:01:29 -0600
|
|
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
|
|
--- 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;
|
|
import net.minecraft.nbt.NbtUtils;
|
|
import net.minecraft.resources.ResourceLocation;
|
|
import net.minecraft.world.level.block.entity.SkullBlockEntity;
|
|
+import org.apache.commons.lang3.StringUtils; // Scissors
|
|
import org.bukkit.Bukkit;
|
|
import org.bukkit.Material;
|
|
import org.bukkit.NamespacedKey;
|
|
@@ -73,7 +74,7 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta {
|
|
|
|
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
|
|
this.setProfile(new GameProfile(null, tag.getString(SKULL_OWNER.NBT)));
|
|
}
|
|
|