From dbb44ab5b9f9ca73b9b0f9d5da483416513133f6 Mon Sep 17 00:00:00 2001 From: Intelli Date: Sat, 11 May 2024 15:09:50 -0600 Subject: [PATCH] Only validate skull owner name length if using MySQL --- .../java/net/coreprotect/paper/Paper_v1_20.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/main/java/net/coreprotect/paper/Paper_v1_20.java b/src/main/java/net/coreprotect/paper/Paper_v1_20.java index 3888dba..3f077ac 100644 --- a/src/main/java/net/coreprotect/paper/Paper_v1_20.java +++ b/src/main/java/net/coreprotect/paper/Paper_v1_20.java @@ -5,6 +5,7 @@ import org.bukkit.block.Sign; import org.bukkit.block.Skull; import org.bukkit.block.sign.Side; +import net.coreprotect.config.Config; import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer; public class Paper_v1_20 extends Paper_v1_17 implements PaperInterface { @@ -23,11 +24,13 @@ public class Paper_v1_20 extends Paper_v1_17 implements PaperInterface { @Override public String getSkullOwner(Skull skull) { String owner = skull.getPlayerProfile().getName(); - if (owner.length() > 255 && skull.getPlayerProfile().getId() != null) { - return skull.getPlayerProfile().getId().toString(); - } - else if (owner.length() > 255) { - return owner.substring(0, 255); + if (Config.getGlobal().MYSQL) { + if (owner.length() > 255 && skull.getPlayerProfile().getId() != null) { + return skull.getPlayerProfile().getId().toString(); + } + else if (owner.length() > 255) { + return owner.substring(0, 255); + } } return owner;