Fix command duplication

This commit is contained in:
boy0001
2015-08-01 15:16:34 +10:00
parent 9b5958da31
commit a4f8292f04
8 changed files with 26 additions and 16 deletions

View File

@ -3,6 +3,7 @@ package com.plotsquared.general.commands;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashSet;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
@ -51,7 +52,8 @@ public class CommandManager<T extends CommandCaller> {
}
final public ArrayList<Command<T>> getCommands() {
ArrayList<Command<T>> result = new ArrayList<>(this.commands.values());
HashSet<Command<T>> set = new HashSet<>(this.commands.values());
ArrayList<Command<T>> result = new ArrayList<>(set);
Collections.sort(result, new Comparator<Command<T>>() {
@Override
public int compare(Command<T> a, Command<T> b) {