changes to tab completion

* PacketCBTabComplete: options for completion should be seperated by
NUL
 * PluginManager: append an empty argument to arguments if command ends
with a whitespace (this will match all suggestions)
 * PlayerCommand: suggest only matching players instead of all players
This commit is contained in:
zaiyers
2013-09-28 16:50:04 +02:00
committed by md_5
parent 891dc87b16
commit dd06937a3b
3 changed files with 28 additions and 13 deletions

View File

@@ -34,18 +34,13 @@ public class PacketCBTabComplete extends DefinedPacket
@Override
public void write(ByteBuf buf)
{
String tab = "";
StringBuilder tab = new StringBuilder();
for ( String alternative : commands )
{
if ( tab.isEmpty() )
{
tab = alternative + " ";
} else
{
tab += "\0" + alternative + " ";
}
tab.append( alternative );
tab.append( "\00" );
}
writeString( tab, buf );
writeString( tab.substring( 0, tab.length() - 1 ), buf );
}
@Override