mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2025-06-11 21:43:54 +00:00
add magical saddle to shop
This commit is contained in:
@ -0,0 +1,29 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.shop.ShopItem;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.OP, source = SourceType.ONLY_IN_GAME)
|
||||
@CommandParameters(description = "Obtain a magical saddle.", usage = "/<command>")
|
||||
public class Command_magicalsaddle extends FreedomCommand
|
||||
{
|
||||
|
||||
@Override
|
||||
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
||||
{
|
||||
if (plugin.pl.getData(playerSender).hasItem(ShopItem.MAGICAL_SADDLE))
|
||||
{
|
||||
playerSender.getInventory().addItem(plugin.sh.getMagicalSaddle());
|
||||
msg("You have been given a Magical Saddle", ChatColor.GREEN);
|
||||
}
|
||||
else
|
||||
{
|
||||
msg("You do not own a Magical Saddle! Purchase one from the shop.", ChatColor.RED);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
@ -28,7 +28,7 @@ public class Command_smite extends FreedomCommand
|
||||
}
|
||||
|
||||
String reason = null;
|
||||
Boolean silent = false;
|
||||
boolean silent = false;
|
||||
if (args.length >= 2)
|
||||
{
|
||||
if (args[args.length - 1].equalsIgnoreCase("-q"))
|
||||
@ -76,18 +76,21 @@ public class Command_smite extends FreedomCommand
|
||||
|
||||
public static void smite(CommandSender sender, Player player, String reason, Boolean silent)
|
||||
{
|
||||
FUtil.bcastMsg(player.getName() + " has been a naughty, naughty boy.", ChatColor.RED);
|
||||
player.sendTitle(ChatColor.RED + "You've been smitten.", ChatColor.YELLOW + "Be sure to follow the rules!", 20, 100, 60);
|
||||
|
||||
if (reason != null)
|
||||
{
|
||||
FUtil.bcastMsg(" Reason: " + ChatColor.YELLOW + reason, ChatColor.RED);
|
||||
}
|
||||
|
||||
if (!silent)
|
||||
{
|
||||
FUtil.bcastMsg(player.getName() + " has been a naughty, naughty boy.", ChatColor.RED);
|
||||
if (reason != null)
|
||||
{
|
||||
FUtil.bcastMsg(" Reason: " + ChatColor.YELLOW + reason, ChatColor.RED);
|
||||
}
|
||||
FUtil.bcastMsg(" Smitten by: " + ChatColor.YELLOW + sender.getName(), ChatColor.RED);
|
||||
}
|
||||
else
|
||||
{
|
||||
sender.sendMessage(ChatColor.GRAY + "Smitten " + player.getName() + " quietly.");
|
||||
}
|
||||
|
||||
// Deop
|
||||
player.setOp(false);
|
||||
@ -119,4 +122,4 @@ public class Command_smite extends FreedomCommand
|
||||
player.sendTitle(ChatColor.RED + "You've been smitten.", ChatColor.YELLOW + "Reason: " + reason, 20, 100, 60);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user