This commit is contained in:
kwteh 2014-03-22 11:25:32 +08:00
parent 302b538a3a
commit 192b9ea9d9

View file

@ -30,12 +30,13 @@ public class Command_cake extends TFM_Command
output.append(ChatColor.COLOR_CHAR).append(color_code).append(word).append(" ");
}
ItemStack heldItem = new ItemStack(Material.CAKE);
ItemMeta heldItemMeta = heldItem.getItemMeta();
heldItemMeta.setDisplayName((new StringBuilder()).append(ChatColor.WHITE).append("The ").append(ChatColor.BLACK).append("Lie").toString());
heldItem.setItemMeta(heldItemMeta);
for (Player player : server.getOnlinePlayers())
{
ItemStack heldItem = new ItemStack(Material.CAKE);
ItemMeta CM = heldItem.getItemMeta();
CM.setDisplayName((new StringBuilder()).append(ChatColor.WHITE).append("The ").append(ChatColor.BLACK).append("Lie").toString());
heldItem.setItemMeta(CM);
player.getInventory().setItem(player.getInventory().firstEmpty(), heldItem);
player.awardAchievement(Achievement.MINE_WOOD);
player.awardAchievement(Achievement.BUILD_WORKBENCH);