summaryrefslogtreecommitdiff
path: root/dicore3/command/src/main/java/io/dico/dicore/command/predef/DefaultGroupCommand.java
blob: 6b389e38d4413138e785c5126683a2751646aa85 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package io.dico.dicore.command.predef;

import io.dico.dicore.command.CommandException;
import io.dico.dicore.command.ExecutionContext;
import io.dico.dicore.command.IContextFilter;
import org.bukkit.command.CommandSender;

public class DefaultGroupCommand extends PredefinedCommand<DefaultGroupCommand> {
    private static final DefaultGroupCommand instance = new DefaultGroupCommand(false);

    public static DefaultGroupCommand getInstance() {
        return instance;
    }

    private DefaultGroupCommand(boolean modifiable) {
        addContextFilter(IContextFilter.INHERIT_PERMISSIONS);
        this.modifiable = modifiable;
    }

    @Override
    protected DefaultGroupCommand newModifiableInstance() {
        return new DefaultGroupCommand(true);
    }

    @Override
    public String execute(CommandSender sender, ExecutionContext context) throws CommandException {
        context.getAddress().getChatController().sendHelpMessage(sender, context, context.getAddress(), 1);
        return null;
    }

}