#3093: Support names with '.', block names with ' '

This commit is contained in:
md_5 2021-05-26 10:31:08 +10:00
parent ab9153ddc3
commit 39a80e414e
No known key found for this signature in database
GPG Key ID: E8E901AC7C617C11
2 changed files with 5 additions and 2 deletions

View File

@ -299,7 +299,10 @@ public class YamlConfig implements ConfigurationAdapter
@SuppressWarnings("unchecked")
public Collection<String> getGroups(String player)
{
Collection<String> groups = get( "groups." + player, null );
// #1270: Do this to support player names with .
Map<String, Collection<String>> raw = get( "groups", Collections.emptyMap() );
Collection<String> groups = raw.get( player );
Collection<String> ret = ( groups == null ) ? new HashSet<String>() : new HashSet<>( groups );
ret.add( "default" );
return ret;

View File

@ -354,7 +354,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection
Preconditions.checkState( thisState == State.USERNAME, "Not expecting USERNAME" );
this.loginRequest = loginRequest;
if ( getName().contains( "." ) )
if ( getName().contains( " " ) )
{
disconnect( bungee.getTranslation( "name_invalid" ) );
return;