mirror of
https://github.com/TotalFreedomMC/TF-LibsDisguises.git
synced 2024-11-11 01:17:16 +00:00
Enforce name lengths on game profile
This commit is contained in:
parent
9604e151f5
commit
55a459e440
1 changed files with 4 additions and 2 deletions
|
@ -694,7 +694,8 @@ public class ReflectionManager {
|
||||||
|
|
||||||
public static WrappedGameProfile getGameProfile(UUID uuid, String playerName) {
|
public static WrappedGameProfile getGameProfile(UUID uuid, String playerName) {
|
||||||
try {
|
try {
|
||||||
return new WrappedGameProfile(uuid != null ? uuid : getRandomUUID(), playerName);
|
return new WrappedGameProfile(uuid != null ? uuid : getRandomUUID(),
|
||||||
|
playerName == null || playerName.length() < 17 ? playerName : playerName.substring(0, 16));
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
}
|
}
|
||||||
|
@ -707,7 +708,8 @@ public class ReflectionManager {
|
||||||
|
|
||||||
public static WrappedGameProfile getGameProfileWithThisSkin(UUID uuid, String playerName, WrappedGameProfile profileWithSkin) {
|
public static WrappedGameProfile getGameProfileWithThisSkin(UUID uuid, String playerName, WrappedGameProfile profileWithSkin) {
|
||||||
try {
|
try {
|
||||||
WrappedGameProfile gameProfile = new WrappedGameProfile(uuid != null ? uuid : getRandomUUID(), playerName);
|
WrappedGameProfile gameProfile = new WrappedGameProfile(uuid != null ? uuid : getRandomUUID(),
|
||||||
|
playerName == null || playerName.length() < 17 ? playerName : playerName.substring(0, 16));
|
||||||
|
|
||||||
if (profileWithSkin != null) {
|
if (profileWithSkin != null) {
|
||||||
gameProfile.getProperties().putAll(profileWithSkin.getProperties());
|
gameProfile.getProperties().putAll(profileWithSkin.getProperties());
|
||||||
|
|
Loading…
Reference in a new issue