TotalFreedomMod/src/me/StevenLawson/TotalFreedomMod/Commands/Command_mp44.java

58 lines
1.8 KiB
Java
Raw Normal View History

2011-10-19 00:37:00 +00:00
package me.StevenLawson.TotalFreedomMod.Commands;
import me.StevenLawson.TotalFreedomMod.TFM_UserInfo;
import me.StevenLawson.TotalFreedomMod.TotalFreedomMod;
2011-10-21 17:02:07 +00:00
import org.bukkit.ChatColor;
import org.bukkit.Material;
2011-10-19 00:37:00 +00:00
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
2011-10-21 17:02:07 +00:00
import org.bukkit.inventory.ItemStack;
2011-10-19 00:37:00 +00:00
public class Command_mp44 extends TFM_Command
{
@Override
public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
{
2011-10-24 02:43:52 +00:00
if (senderIsConsole)
{
sender.sendMessage(TotalFreedomMod.NOT_FROM_CONSOLE);
}
else if (!TotalFreedomMod.mp44Enabled)
2011-10-24 02:43:52 +00:00
{
sender.sendMessage(ChatColor.GREEN + "The mp44 is currently disabled.");
}
else if (sender.isOp())
2011-10-19 00:37:00 +00:00
{
if (args.length == 0)
{
return false;
}
TFM_UserInfo playerdata = TFM_UserInfo.getPlayerData(sender_p);
2011-10-19 00:37:00 +00:00
if (args[0].equalsIgnoreCase("draw"))
{
2011-10-21 17:02:07 +00:00
playerdata.armMP44();
sender.sendMessage(ChatColor.GREEN + "mp44 is ARMED! Left click with gunpowder to start firing, left click again to quit.");
sender.sendMessage(ChatColor.GREEN + "Type /mp44 sling to disable. -by Madgeek1450");
sender_p.setItemInHand(new ItemStack(Material.SULPHUR, 1));
2011-10-19 00:37:00 +00:00
}
else
{
2011-10-21 17:02:07 +00:00
playerdata.disarmMP44();
sender.sendMessage(ChatColor.GREEN + "mp44 Disarmed.");
2011-10-19 00:37:00 +00:00
}
}
else
{
sender.sendMessage(TotalFreedomMod.MSG_NO_PERMS);
}
return true;
}
}