mirror of
https://github.com/PlayPro/CoreProtect.git
synced 2025-01-30 23:01:44 +01:00
Only validate skull owner name length if using MySQL
This commit is contained in:
parent
fbc68766f6
commit
90a2981603
@ -5,6 +5,7 @@ import org.bukkit.block.Sign;
|
|||||||
import org.bukkit.block.Skull;
|
import org.bukkit.block.Skull;
|
||||||
import org.bukkit.block.sign.Side;
|
import org.bukkit.block.sign.Side;
|
||||||
|
|
||||||
|
import net.coreprotect.config.Config;
|
||||||
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
|
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
|
||||||
|
|
||||||
public class Paper_v1_20 extends Paper_v1_17 implements PaperInterface {
|
public class Paper_v1_20 extends Paper_v1_17 implements PaperInterface {
|
||||||
@ -23,12 +24,14 @@ public class Paper_v1_20 extends Paper_v1_17 implements PaperInterface {
|
|||||||
@Override
|
@Override
|
||||||
public String getSkullOwner(Skull skull) {
|
public String getSkullOwner(Skull skull) {
|
||||||
String owner = skull.getPlayerProfile().getName();
|
String owner = skull.getPlayerProfile().getName();
|
||||||
|
if (Config.getGlobal().MYSQL) {
|
||||||
if (owner.length() > 255 && skull.getPlayerProfile().getId() != null) {
|
if (owner.length() > 255 && skull.getPlayerProfile().getId() != null) {
|
||||||
return skull.getPlayerProfile().getId().toString();
|
return skull.getPlayerProfile().getId().toString();
|
||||||
}
|
}
|
||||||
else if (owner.length() > 255) {
|
else if (owner.length() > 255) {
|
||||||
return owner.substring(0, 255);
|
return owner.substring(0, 255);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return owner;
|
return owner;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user