0.3h Fix userOrder
This commit is contained in:
parent
dc89b439a0
commit
7b69175c0f
@ -87,7 +87,14 @@ public abstract class TypeAbstract<T> implements Type<T>
|
||||
private List<Integer> userOrder = null;
|
||||
@Override public void setUserOrder(List<Integer> userOrder) { this.userOrder = userOrder; }
|
||||
@Override public void setUserOrder(Integer... userOrder) { this.setUserOrder(Arrays.asList(userOrder)); }
|
||||
@Override public List<Integer> getUserOrder() { return this.userOrder; }
|
||||
@Override public List<Integer> getUserOrder()
|
||||
{
|
||||
if (this.userOrder == null)
|
||||
{
|
||||
this.userOrder = MUtil.range(0, this.getInnerTypes().size());
|
||||
}
|
||||
return this.userOrder;
|
||||
}
|
||||
@Override
|
||||
public Integer getIndexUser(int indexTechy)
|
||||
{
|
||||
|
@ -17,12 +17,12 @@ import java.util.Iterator;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.Set;
|
||||
import java.util.SortedSet;
|
||||
import java.util.TreeSet;
|
||||
import java.util.UUID;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
@ -554,6 +554,15 @@ public class MUtil
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
public static List<Integer> range(int from, int to)
|
||||
{
|
||||
List<Integer> ret = new MassiveList<>(to - from);
|
||||
for (int i = from; i < to; i++)
|
||||
{
|
||||
ret.add(i);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static void keepLeft(List<?> list, int maxlength)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user