mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-27 01:05:38 +00:00
shut up nerd. delet #103
This commit is contained in:
parent
c0e16ee9c7
commit
f8b5078f84
@ -2,17 +2,22 @@ package me.totalfreedom.totalfreedommod.command;
|
|||||||
|
|
||||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||||
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
import org.bukkit.inventory.meta.ItemMeta;
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH)
|
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH)
|
||||||
public class Command_cookie extends FreedomCommand
|
public class Command_cookie extends FreedomCommand
|
||||||
{
|
{
|
||||||
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 COOKIE_LYRICS = "Imagine that you have zero cookies and you divide them evenly among zero friends. How many cookies does each person get? See, it doesn't " +
|
||||||
|
"seem to make sense, and Cookie Monster is sad there are no cookies, and you are sad you have no friends.";
|
||||||
|
public static final String LORE = "But, you can have a cookie anyways,\nsince you are sad you are have no friends.";
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
||||||
{
|
{
|
||||||
@ -22,8 +27,29 @@ public class Command_cookie extends FreedomCommand
|
|||||||
{
|
{
|
||||||
output.append(FUtil.randomChatColor()).append(word).append(" ");
|
output.append(FUtil.randomChatColor()).append(word).append(" ");
|
||||||
}
|
}
|
||||||
ItemStack heldItem = new ItemStack(Material.COOKIE, 1);
|
|
||||||
|
final StringBuilder name = new StringBuilder();
|
||||||
|
|
||||||
|
name.append(ChatColor.DARK_RED).append("C")
|
||||||
|
.append(ChatColor.GOLD).append("o")
|
||||||
|
.append(ChatColor.YELLOW).append("o")
|
||||||
|
.append(ChatColor.DARK_GREEN).append("k")
|
||||||
|
.append(ChatColor.DARK_BLUE).append("i")
|
||||||
|
.append(ChatColor.DARK_PURPLE).append("e");
|
||||||
|
|
||||||
|
final StringBuilder lore = new StringBuilder();
|
||||||
|
|
||||||
|
for (final String word : LORE.split(" "))
|
||||||
|
{
|
||||||
|
lore.append(FUtil.randomChatColor()).append(word).append(" ");
|
||||||
|
}
|
||||||
|
|
||||||
|
final ItemStack heldItem = new ItemStack(Material.COOKIE);
|
||||||
|
final ItemMeta heldItemMeta = heldItem.getItemMeta();
|
||||||
|
heldItemMeta.setDisplayName(name.toString());
|
||||||
|
heldItemMeta.setLore(Arrays.asList(lore.toString().split("\n")));
|
||||||
|
heldItem.setItemMeta(heldItemMeta);
|
||||||
|
|
||||||
for (final Player player : server.getOnlinePlayers())
|
for (final Player player : server.getOnlinePlayers())
|
||||||
{
|
{
|
||||||
final int firstEmpty = player.getInventory().firstEmpty();
|
final int firstEmpty = player.getInventory().firstEmpty();
|
||||||
|
Loading…
Reference in New Issue
Block a user