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

50 lines
1.5 KiB
Java
Raw Normal View History

2011-10-19 00:37:00 +00:00
package me.StevenLawson.TotalFreedomMod.Commands;
2013-01-21 18:58:42 +00:00
import me.StevenLawson.TotalFreedomMod.TFM_PlayerData;
2011-10-19 00:37:00 +00:00
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
@CommandPermissions(level = AdminLevel.OP, source = SourceType.ONLY_IN_GAME)
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)
{
if (!TotalFreedomMod.mp44Enabled)
2011-10-24 02:43:52 +00:00
{
playerMsg("The mp44 is currently disabled.", ChatColor.GREEN);
return true;
2011-10-24 02:43:52 +00:00
}
if (args.length == 0)
2011-10-24 02:43:52 +00:00
{
return false;
2011-10-24 02:43:52 +00:00
}
2013-01-21 18:58:42 +00:00
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(sender_p);
if (args[0].equalsIgnoreCase("draw"))
2011-10-19 00:37:00 +00:00
{
playerdata.armMP44();
playerMsg("mp44 is ARMED! Left click with gunpowder to start firing, left click again to quit.", ChatColor.GREEN);
playerMsg("Type /mp44 sling to disable. -by Madgeek1450", ChatColor.GREEN);
sender_p.setItemInHand(new ItemStack(Material.SULPHUR, 1));
2011-10-19 00:37:00 +00:00
}
else
{
playerdata.disarmMP44();
sender.sendMessage(ChatColor.GREEN + "mp44 Disarmed.");
2011-10-19 00:37:00 +00:00
}
return true;
}
}