Add UUID tab completion with threshold.
This commit is contained in:
parent
1053646a45
commit
fabf315bb5
@ -38,6 +38,8 @@ public abstract class TypeAbstract<T> implements Type<T>
|
|||||||
public static final ChatColor COLOR_DEFAULT = ChatColor.YELLOW;
|
public static final ChatColor COLOR_DEFAULT = ChatColor.YELLOW;
|
||||||
public static final ChatColor COLOR_NUMBER = ChatColor.LIGHT_PURPLE;
|
public static final ChatColor COLOR_NUMBER = ChatColor.LIGHT_PURPLE;
|
||||||
|
|
||||||
|
public static final int TAB_LIST_UUID_THRESHOLD = 5;
|
||||||
|
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
// META
|
// META
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
@ -155,10 +155,14 @@ public abstract class TypeSenderIdAbstract<T> extends TypeAbstract<T>
|
|||||||
Set<String> ids = IdUtil.getIds(presence, type);
|
Set<String> ids = IdUtil.getIds(presence, type);
|
||||||
|
|
||||||
// Step 4: Create Ret with visible names
|
// Step 4: Create Ret with visible names
|
||||||
Set<String> ret = new MassiveSet<String>(ids.size());
|
boolean addIds = (arg.length() >= TAB_LIST_UUID_THRESHOLD);
|
||||||
|
int size = ids.size();
|
||||||
|
if (addIds) size *= 2;
|
||||||
|
Set<String> ret = new MassiveSet<String>(size);
|
||||||
for (String id : ids)
|
for (String id : ids)
|
||||||
{
|
{
|
||||||
if ( ! Mixin.isVisible(id, sender)) continue;
|
if ( ! Mixin.isVisible(id, sender)) continue;
|
||||||
|
if (addIds) ret.add(id);
|
||||||
String name = IdUtil.getName(id);
|
String name = IdUtil.getName(id);
|
||||||
if (name == null) continue;
|
if (name == null) continue;
|
||||||
ret.add(name);
|
ret.add(name);
|
||||||
|
Loading…
Reference in New Issue
Block a user