-
-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
6 changed files
with
74 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
core/src/main/java/me/blackvein/quests/commands/quests/subcommands/QuestsChoiceCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
package me.blackvein.quests.commands.quests.subcommands; | ||
|
||
import org.bukkit.ChatColor; | ||
import org.bukkit.command.CommandSender; | ||
import org.bukkit.entity.Player; | ||
|
||
import me.blackvein.quests.commands.QuestsSubCommand; | ||
import me.blackvein.quests.util.Lang; | ||
|
||
public class QuestsChoiceCommand extends QuestsSubCommand { | ||
|
||
@Override | ||
public String getName() { | ||
return "choice"; | ||
} | ||
|
||
@Override | ||
public String getNameI18N() { | ||
return Lang.get("COMMAND_CHOICE"); | ||
} | ||
|
||
@Override | ||
public String getDescription() { | ||
return Lang.get("COMMAND_CHOICE_HELP"); | ||
} | ||
|
||
@Override | ||
public String getPermission() { | ||
return "quests.choice"; | ||
} | ||
|
||
@Override | ||
public String getSyntax() { | ||
return "/quests choice"; | ||
} | ||
|
||
@Override | ||
public int getMaxArguments() { | ||
return 2; | ||
} | ||
|
||
@Override | ||
public void execute(CommandSender cs, String[] args) { | ||
if (assertNonPlayer(cs)) { | ||
return; | ||
} | ||
Player player = (Player) cs; | ||
if (!cs.hasPermission(getPermission())) { | ||
Lang.send(player, ChatColor.RED + Lang.get(player, "noPermission")); | ||
return; | ||
} | ||
if (!player.isConversing()) { | ||
Lang.send(player, ChatColor.RED + Lang.get(player, "notConversing")); | ||
return; | ||
} | ||
if (args.length == 1) { | ||
return; | ||
} | ||
player.acceptConversationInput(concatArgArray(args, 1, args.length - 1, ' ')); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters