Added VoteCommand that sends a player a message containing the voting link.

This commit is contained in:
Nicholas Rees 2021-05-06 12:27:49 -05:00
parent d2177c02a4
commit 726cc05a2f
3 changed files with 19 additions and 5 deletions

@ -3,7 +3,6 @@ package zone.themcgamer.core.api;
import com.google.gson.JsonElement; import com.google.gson.JsonElement;
import com.google.gson.JsonObject; import com.google.gson.JsonObject;
import lombok.NonNull; import lombok.NonNull;
import org.apache.commons.lang3.StringEscapeUtils;
import zone.themcgamer.core.api.json.JsonRequest; import zone.themcgamer.core.api.json.JsonRequest;
import zone.themcgamer.core.api.json.JsonResponse; import zone.themcgamer.core.api.json.JsonResponse;
import zone.themcgamer.data.ChatFilterLevel; import zone.themcgamer.data.ChatFilterLevel;

@ -15,10 +15,7 @@ import zone.themcgamer.common.TriTuple;
import zone.themcgamer.core.account.Account; import zone.themcgamer.core.account.Account;
import zone.themcgamer.core.account.AccountManager; import zone.themcgamer.core.account.AccountManager;
import zone.themcgamer.core.command.help.HelpCommand; import zone.themcgamer.core.command.help.HelpCommand;
import zone.themcgamer.core.command.impl.DiscordCommand; import zone.themcgamer.core.command.impl.*;
import zone.themcgamer.core.command.impl.RulesCommand;
import zone.themcgamer.core.command.impl.StoreCommand;
import zone.themcgamer.core.command.impl.StressTestCommand;
import zone.themcgamer.core.command.impl.essentials.GameModeCommand; import zone.themcgamer.core.command.impl.essentials.GameModeCommand;
import zone.themcgamer.core.command.impl.essentials.TeleportCommand; import zone.themcgamer.core.command.impl.essentials.TeleportCommand;
import zone.themcgamer.core.common.Style; import zone.themcgamer.core.common.Style;
@ -96,6 +93,7 @@ public class CommandManager extends Module implements CommandExecutor {
registerCommand(plugin, new zone.themcgamer.core.command.impl.HelpCommand(this)); registerCommand(plugin, new zone.themcgamer.core.command.impl.HelpCommand(this));
registerCommand(plugin, new DiscordCommand()); registerCommand(plugin, new DiscordCommand());
registerCommand(plugin, new StoreCommand()); registerCommand(plugin, new StoreCommand());
registerCommand(plugin, new VoteCommand());
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, () -> { Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, () -> {
for (String disabledCommand : DISABLED_COMMANDS) { for (String disabledCommand : DISABLED_COMMANDS) {

@ -0,0 +1,17 @@
package zone.themcgamer.core.command.impl;
import lombok.AllArgsConstructor;
import zone.themcgamer.core.command.Command;
import zone.themcgamer.core.command.CommandProvider;
import zone.themcgamer.core.common.Style;
/**
* @author Nicholas
*/
@AllArgsConstructor
public class VoteCommand {
@Command(name = "vote", description = "Vote for McGamerZone", playersOnly = true)
public void onCommand(CommandProvider command) {
command.getPlayer().sendMessage(Style.main("Vote", "Vote for McGamerZone at §dhttps://vote.mcgamerzone.net§7."));
}
}