2015-10-19 17:43:46 +00:00
|
|
|
package me.totalfreedom.totalfreedommod.commands;
|
2011-10-19 00:37:00 +00:00
|
|
|
|
2015-11-15 23:32:04 +00:00
|
|
|
import me.totalfreedom.totalfreedommod.rank.PlayerRank;
|
2015-10-19 17:43:46 +00:00
|
|
|
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
|
|
|
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
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
|
|
|
|
2015-10-19 17:43:46 +00:00
|
|
|
@CommandPermissions(level = PlayerRank.OP, source = SourceType.ONLY_IN_GAME)
|
2013-04-10 02:05:24 +00:00
|
|
|
@CommandParameters(description = "Modern weaponry, FTW. Use 'draw' to start firing, 'sling' to stop firing.", usage = "/<command> <draw | sling>")
|
2015-10-19 17:43:46 +00:00
|
|
|
public class Command_mp44 extends FreedomCommand
|
2011-10-19 00:37:00 +00:00
|
|
|
{
|
2015-11-22 18:26:47 +00:00
|
|
|
|
2011-10-19 00:37:00 +00:00
|
|
|
@Override
|
2015-11-22 18:26:47 +00:00
|
|
|
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
2011-10-19 00:37:00 +00:00
|
|
|
{
|
2015-10-19 17:43:46 +00:00
|
|
|
if (!ConfigEntry.MP44_ENABLED.getBoolean())
|
2011-10-24 02:43:52 +00:00
|
|
|
{
|
2013-01-07 14:56:53 +00:00
|
|
|
playerMsg("The mp44 is currently disabled.", ChatColor.GREEN);
|
2012-11-24 01:22:52 +00:00
|
|
|
return true;
|
2011-10-24 02:43:52 +00:00
|
|
|
}
|
2012-11-24 01:22:52 +00:00
|
|
|
|
|
|
|
if (args.length == 0)
|
2011-10-24 02:43:52 +00:00
|
|
|
{
|
2012-11-24 01:22:52 +00:00
|
|
|
return false;
|
2011-10-24 02:43:52 +00:00
|
|
|
}
|
2012-11-24 01:22:52 +00:00
|
|
|
|
2015-11-22 18:26:47 +00:00
|
|
|
FPlayer playerdata = plugin.pl.getPlayer(playerSender);
|
2012-11-24 01:22:52 +00:00
|
|
|
|
|
|
|
if (args[0].equalsIgnoreCase("draw"))
|
2011-10-19 00:37:00 +00:00
|
|
|
{
|
2012-11-24 01:22:52 +00:00
|
|
|
playerdata.armMP44();
|
|
|
|
|
2013-01-07 14:56:53 +00:00
|
|
|
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);
|
2012-11-24 01:22:52 +00:00
|
|
|
|
2015-11-22 18:26:47 +00:00
|
|
|
playerSender.setItemInHand(new ItemStack(Material.SULPHUR, 1));
|
2011-10-19 00:37:00 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2012-11-24 01:22:52 +00:00
|
|
|
playerdata.disarmMP44();
|
|
|
|
|
|
|
|
sender.sendMessage(ChatColor.GREEN + "mp44 Disarmed.");
|
2011-10-19 00:37:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|