本文整理汇总了Java中org.bukkit.Material.RAW_FISH属性的典型用法代码示例。如果您正苦于以下问题:Java Material.RAW_FISH属性的具体用法?Java Material.RAW_FISH怎么用?Java Material.RAW_FISH使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.bukkit.Material
的用法示例。
在下文中一共展示了Material.RAW_FISH属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCommand
@Override
public boolean onCommand(CommandSender arg0, Command arg1, String arg2, String[] arg3) {
if (arg0 instanceof Player) {
Player meowPlayer = (Player) arg0;
// Create a new ItemStack (type: diamond)
ItemStack rawFish = new ItemStack(Material.RAW_FISH);
// Create a new ItemStack (type: brick)
ItemStack book = new ItemStack(Material.BOOK);
// Set the amount of the ItemStack
book.setAmount(20);
// Give the player our items (comma-seperated list of all ItemStack)
meowPlayer.getInventory().addItem(book, rawFish);
} else {
getLogger().info("hai nun human!");
}
// If the player (or console) uses our command correct, we can return true
return true;
}
示例2: nerfFishing
@EventHandler
public void nerfFishing(PlayerFishEvent event) {
if (Config.Fishing.disableTreasure() && event.getCaught() instanceof Item) {
Item caught = (Item) event.getCaught();
if (caught.getItemStack().getType() != Material.RAW_FISH) {
caught.setItemStack(new ItemStack(Material.RAW_FISH));
}
}
}
示例3: smeltCheck
public boolean smeltCheck(Inventory inv, ItemStack item)
{
boolean canSmelt = true;
if(item == null)
canSmelt = false;
else if(item.getType() == Material.PORK)
inv.setItem(2, new ItemStack(Material.GRILLED_PORK));
else if(item.getType() == Material.RAW_BEEF)
inv.setItem(2, new ItemStack(Material.COOKED_BEEF));
else if(item.getType() == Material.RAW_CHICKEN)
inv.setItem(2, new ItemStack(Material.COOKED_CHICKEN));
else if(item.getType() == Material.RAW_FISH)
inv.setItem(2, new ItemStack(Material.COOKED_FISH, 1, item.getDurability()));
else if(item.getType() == Material.POTATO_ITEM)
inv.setItem(2, new ItemStack(Material.BAKED_POTATO));
else if(item.getType() == Material.MUTTON)
inv.setItem(2, new ItemStack(Material.COOKED_MUTTON));
else if(item.getType() == Material.RABBIT)
inv.setItem(2, new ItemStack(Material.COOKED_RABBIT));
else if(item.getType() == Material.SAND)
inv.setItem(2, new ItemStack(Material.GLASS));
else if(item.getType() == Material.CLAY_BALL)
inv.setItem(2, new ItemStack(Material.CLAY_BRICK));
else if(item.getType() == Material.LOG)
inv.setItem(2, new ItemStack(Material.COAL, 1, (short)1));
else if(item.getType() == Material.LOG_2)
inv.setItem(2, new ItemStack(Material.COAL, 1, (short)1));
else
canSmelt = false;
return canSmelt;
}
示例4: getIcon
public ItemStack getIcon(Player player)
{
boolean able = this.isAbleFor(player);
ItemStack stack = new ItemStack(able ? Material.COOKED_FISH : Material.RAW_FISH, 1);
ItemMeta meta = stack.getItemMeta();
meta.setDisplayName(this.name);
List<String> lore = new ArrayList<>(Arrays.asList(this.description));
lore.add("");
if (!able)
{
long millis = new Date(this.getUnlockTime(player)).getTime() - new Date().getTime();
long days = millis / (1000 * 60 * 60 * 24);
long hours = (millis / (1000 * 60 * 60)) % 24;
long minutes = (millis / (1000 * 60)) % 60;
lore.add(ChatColor.RED + "Vous pourrez récupérer ce");
lore.add(ChatColor.RED + "bonus dans : ");
lore.add(ChatColor.RED + "" + days + " jour" + (days > 1 ? "s" : "") + " " + hours + " heure" + (hours > 1 ? "s" : "") + " et " + minutes + " minute" + (minutes > 1 ? "s" : "") + ".");
}
else
{
lore.add(ChatColor.GREEN + "Récupérer votre bonus dès");
lore.add(ChatColor.GREEN + "maintenant !");
}
meta.setLore(lore);
stack.setItemMeta(meta);
return stack;
}
示例5: isBrewingIngredient
private static boolean isBrewingIngredient(ItemStack item) {
if (item.getType() == Material.NETHER_STALK) {
return true;
}
if (item.getType() == Material.SPECKLED_MELON) {
return true;
}
if (item.getType() == Material.GHAST_TEAR) {
return true;
}
if (item.getType() == Material.RABBIT_FOOT) {
return true;
}
if (item.getType() == Material.BLAZE_POWDER) {
return true;
}
if (item.getType() == Material.SPIDER_EYE) {
return true;
}
if (item.getType() == Material.SUGAR) {
return true;
}
if (item.getType() == Material.MAGMA_CREAM) {
return true;
}
if (item.getType() == Material.GLOWSTONE_DUST) {
return true;
}
if (item.getType() == Material.REDSTONE) {
return true;
}
if (item.getType() == Material.FERMENTED_SPIDER_EYE) {
return true;
}
if (item.getType() == Material.GOLDEN_CARROT) {
return true;
}
if (item.getType() == Material.RAW_FISH && item.getData().getData() == 3) {
return true;
}
if (item.getType() == Material.SULPHUR) {
return true;
}
return false;
}