mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-26 17:05:01 +00:00
Added /cookie
This commit is contained in:
parent
63b80d0d69
commit
cd6251d07d
@ -0,0 +1,37 @@
|
||||
package me.StevenLawson.TotalFreedomMod.Commands;
|
||||
|
||||
import java.util.Random;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_Util;
|
||||
import me.StevenLawson.TotalFreedomMod.TotalFreedomMod;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
@CommandPermissions(level = ADMIN_LEVEL.SUPER, source = SOURCE_TYPE_ALLOWED.BOTH, ignore_permissions = true)
|
||||
public class Command_cookie extends TFM_Command
|
||||
{
|
||||
@Override
|
||||
public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
||||
{
|
||||
StringBuilder output = new StringBuilder();
|
||||
Random randomGenerator = new Random();
|
||||
|
||||
for (String word : TotalFreedomMod.COOKIE_LYRICS.split(" "))
|
||||
{
|
||||
String color_code = Integer.toHexString(1 + randomGenerator.nextInt(14));
|
||||
output.append("§").append(color_code).append(word).append(" ");
|
||||
}
|
||||
|
||||
for (Player p : server.getOnlinePlayers())
|
||||
{
|
||||
ItemStack heldItem = new ItemStack(Material.COOKIE, 1);
|
||||
p.getInventory().setItem(p.getInventory().firstEmpty(), heldItem);
|
||||
}
|
||||
|
||||
TFM_Util.bcastMsg(output.toString());
|
||||
return true;
|
||||
}
|
||||
}
|
@ -41,6 +41,7 @@ public class TotalFreedomMod extends JavaPlugin
|
||||
public static final String YOU_ARE_OP = ChatColor.YELLOW + "You are now op!";
|
||||
public static final String YOU_ARE_NOT_OP = ChatColor.YELLOW + "You are no longer op!";
|
||||
public static final String CAKE_LYRICS = "But there's no sense crying over every mistake. You just keep on trying till you run out of cake.";
|
||||
public static final String COOKIE_LYRICS = "But there's no sense crying over every mistake. You just keep on trying till you run out of cookies.";
|
||||
public static final String NOT_FROM_CONSOLE = "This command may not be used from the console.";
|
||||
|
||||
public static boolean allPlayersFrozen = false;
|
||||
|
@ -22,6 +22,9 @@ commands:
|
||||
cmdlist:
|
||||
description: Show all commands for all server plugins.
|
||||
usage: /<command>
|
||||
cookie:
|
||||
description: Superadmin command - cookies :)
|
||||
usage: /<command>
|
||||
creative:
|
||||
description: Quickly change your own gamemode to creative, or define someone's username to change theirs.
|
||||
usage: /<command> [partialname]
|
||||
|
Loading…
Reference in New Issue
Block a user