Merge branch 'master' into 1.17

This commit is contained in:
gnembon committed 2021-05-27 01:56:13 -03:00
commit e2dfbc5bdd
4 files changed
+47 -3

No files matched your search

@@ -272,7 +272,7 @@ public class PlayerCommand
}
catch (CommandSyntaxException ignored) {}
String playerName = StringArgumentType.getString(context, "player");
if (playerName.length()>40)
if (playerName.length()>maxPlayerLength(source.getMinecraftServer()))
{
Messenger.m(context.getSource(), "rb Player name: "+playerName+" is too long");
return 0;
@@ -294,6 +294,11 @@ public class PlayerCommand
return 1;
}
private static int maxPlayerLength(MinecraftServer server)
{
return server.getServerPort() >= 0 ? 16 : 40;
}
private static int stop(CommandContext<ServerCommandSource> context)
{
if (cantManipulate(context)) return 0;