Simplify SWCommandBundle
Dieser Commit ist enthalten in:
Ursprung
085382296f
Commit
27b8bd43da
@ -24,7 +24,6 @@ import org.bukkit.entity.Player;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.function.BiConsumer;
|
|
||||||
|
|
||||||
public class SWCommandBundle {
|
public class SWCommandBundle {
|
||||||
|
|
||||||
@ -36,17 +35,6 @@ public class SWCommandBundle {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public SWCommandBundle addAll(SWCommandBundle swCommandBundle) {
|
|
||||||
if (swCommandBundle == null) return this;
|
|
||||||
swCommandList.addAll(swCommandBundle.swCommandList);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public SWCommandBundle addAll(BiConsumer<Player, ArgumentMap> executor, List<Argument<?>[]> arguments) {
|
|
||||||
arguments.forEach(args -> swCommandList.add(new SWCommand(executor, args)));
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean execute(Player player, String[] args) {
|
public boolean execute(Player player, String[] args) {
|
||||||
for (SWCommand swCommand : swCommandList) {
|
for (SWCommand swCommand : swCommandList) {
|
||||||
if (swCommand.execute(player, args)) return true;
|
if (swCommand.execute(player, args)) return true;
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren