mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-23 13:46:46 +01:00
0ba4bc25c7
buggy.
37 lines
1.1 KiB
Java
37 lines
1.1 KiB
Java
package com.gmail.nossr50.commands;
|
|
|
|
import java.util.List;
|
|
|
|
import org.bukkit.command.Command;
|
|
import org.bukkit.command.CommandSender;
|
|
import org.bukkit.command.TabExecutor;
|
|
import org.bukkit.entity.Player;
|
|
|
|
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
|
import com.gmail.nossr50.locale.LocaleLoader;
|
|
import com.gmail.nossr50.util.player.UserManager;
|
|
|
|
import com.google.common.collect.ImmutableList;
|
|
|
|
public class McnotifyCommand implements TabExecutor {
|
|
@Override
|
|
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
|
switch (args.length) {
|
|
case 0:
|
|
McMMOPlayer mcMMOPlayer = UserManager.getPlayer((Player) sender);
|
|
|
|
sender.sendMessage(LocaleLoader.getString("Commands.Notifications." + (mcMMOPlayer.useChatNotifications() ? "Off" : "On")));
|
|
mcMMOPlayer.toggleChatNotifications();
|
|
return true;
|
|
|
|
default:
|
|
return false;
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
|
|
return ImmutableList.of();
|
|
}
|
|
}
|