Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.zarketh.model.entity.player.commands.impl;
- import com.zarketh.InstanceDistributor;
- import com.zarketh.model.entity.player.Player;
- import com.zarketh.model.entity.player.commands.Command;
- import com.zarketh.util.Misc;
- /**
- * Handles the yell command, send a global message from user.
- *
- * @author Renual
- * @author Jordon
- */
- public class Yell implements Command {
- @Override
- public void execute(final Player player, final String command) {
- if (player.getPrivileges() >= 1)
- if (command.length() > 5) {
- final String words = command.substring(5);
- if (player.isYellMuted() || player.isMuted()) {
- player.getActionSender().sendMessage("You are muted.");
- return;
- }
- String prefix = "";
- if (player.getPrivileges() > 5 && player.getPrivileges() < 8 && System.currentTimeMillis() - player.donatorTimer > 60000) {
- if (player.getPrivileges() == 8) {
- prefix = "[Supporter]";
- } else if (player.getPrivileges() == 7) {
- prefix = "<shad=15695415>[Donator]</col><img=0>";
- } else if (player.getPrivileges() == 6) {
- prefix = "<shad=15695415>[Super Donator]</col><img=0>";
- } else if (player.getPrivileges() == 5) {
- prefix = "<shad=15695415>[Extreme Donator]</col><img=0>";
- } else if (player.getPrivileges() == 4 && !player.username.equalsIgnoreCase("mitchell")) {
- prefix = "[V. I. P]";
- } else if (player.username.equalsIgnoreCase("mitchell")) {
- prefix = "<shad=16777215>[Co Owner]</col><img=2>";
- } else if (player.getPrivileges() == 3) {
- prefix = "<shad=16777215>[Owner]</col><img=2>";
- } else if (player.getPrivileges() == 2) {
- prefix = "<shad=6081134>[Administrator]</col><img=2>";
- } else if (player.getPrivileges() == 1) {
- prefix = "<shad=255>[Moderator]</col><img=1>";
- }
- player.donatorTimer = System.currentTimeMillis();
- InstanceDistributor.getGlobalActions().sendMessage(prefix + Misc.capitalizeFirstLetter(player.getUsername()) + ": " + words);
- } else {
- player.getActionSender().sendMessage("You must wait 60 seconds between each yell.");
- }
- } else
- player.getActionSender().sendMessage("Syntax is ::yell <message>.");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement