當前位置: 首頁>>代碼示例>>Java>>正文


Java Material.IRON_INGOT屬性代碼示例

本文整理匯總了Java中org.bukkit.Material.IRON_INGOT屬性的典型用法代碼示例。如果您正苦於以下問題:Java Material.IRON_INGOT屬性的具體用法?Java Material.IRON_INGOT怎麽用?Java Material.IRON_INGOT使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在org.bukkit.Material的用法示例。


在下文中一共展示了Material.IRON_INGOT屬性的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: addMetaIfNeeded

private ItemStack addMetaIfNeeded(ItemStack stack)
{
    Material material = stack.getType();

    if (material == Material.COAL || material == Material.IRON_INGOT || material == Material.GOLD_INGOT || material == Material.DIAMOND || material == Material.EMERALD || material == Material.QUARTZ)
        return Meta.addMeta(stack);
    else
        return stack;
}
 
開發者ID:SamaGames,項目名稱:SurvivalAPI,代碼行數:9,代碼來源:RandomChestModule.java

示例2: onBlockBreak

@EventHandler(ignoreCancelled = true, priority = EventPriority.HIGHEST)
public void onBlockBreak(final BlockBreakEvent event) {
    Player player = event.getPlayer();
    if (player.getGameMode() != GameMode.CREATIVE) {
        if (player.hasPermission("hcf.listener.autosmeltore")) {
            ItemStack stack = player.getItemInHand();
            if (stack != null && stack.getType() != Material.AIR
                    && !stack.containsEnchantment(Enchantment.SILK_TOUCH)) {
                Block block = event.getBlock();
                Material dropType = null;
                switch (block.getType()) {
                    case IRON_ORE: {
                        dropType = Material.IRON_INGOT;
                        break;
                    }
                    case GOLD_ORE: {
                        dropType = Material.GOLD_INGOT;
                        break;
                    }
                    default: {
                        return;
                    }
                }
                 Location location = block.getLocation();
                 World world = location.getWorld();
                 ItemStack drop = new ItemStack(dropType, 1);
                world.dropItemNaturally(location, drop);
                block.setType(Material.AIR);
                block.getState().update();
            }
        }
    }
}
 
開發者ID:funkemunky,項目名稱:HCFCore,代碼行數:33,代碼來源:AutoSmeltOreListener.java

示例3: openStatsGUI

public void openStatsGUI(Player p){
 inv = Bukkit.createInventory(null, 27, ChatColor.DARK_GRAY + "Stats");
 /*List<String> armamentLore = new ArrayList();
 armamentLore.add(ChatColor.BLUE + "Level: "+ ChatColor.GREEN + getArmamentHakiLevel(p.getName()));
 armamentLore.add(ChatColor.BLUE + "XP: " + ChatColor.GREEN + getArmamentHakiXP(p.getName()));
 armamentLore.add(ChatColor.BLUE + "XP Needed: " + ChatColor.GREEN +  ((armamentHakiLevels[getArmamentHakiLevel(p.getName()) + 1])- (getArmamentHakiXP(p.getName()))));
 
 List<String> observationLore = new ArrayList();
 observationLore.add(ChatColor.BLUE + "Level: "+ ChatColor.GREEN + getObservationHakiLevel(p.getName()));
 observationLore.add(ChatColor.BLUE + "XP: " + ChatColor.GREEN + getObservationHakiXP(p.getName()));
 observationLore.add(ChatColor.BLUE + "XP Needed: " + ChatColor.GREEN +  ((armamentHakiLevels[getObservationHakiLevel(p.getName()) + 1])- (getObservationHakiXP(p.getName()))));
 
 List<String> conquerorLore = new ArrayList();
 conquerorLore.add(ChatColor.BLUE + "Level: "+ ChatColor.GREEN + getConquerorHakiLevel(p.getName()));
 conquerorLore.add(ChatColor.BLUE + "XP: " + ChatColor.GREEN + getConquerorHakiXP(p.getName()));
 conquerorLore.add(ChatColor.BLUE + "XP Needed: " + ChatColor.GREEN +  ((armamentHakiLevels[getConquerorHakiLevel(p.getName()) + 1])- (getConquerorHakiXP(p.getName()))));
 */
 ItemStack skull = new ItemStack(Material.SKULL_ITEM, 1, (short) SkullType.PLAYER.ordinal());
 ItemStack className = new ItemStack(Material.BOOK);
 ItemMeta classNameMeta = className.getItemMeta();
 ItemStack kills = new ItemStack(Material.IRON_SWORD);
 ItemMeta killsMeta = kills.getItemMeta();
 ItemStack deaths = new ItemStack(Material.BONE);
 ItemMeta deathsMeta = deaths.getItemMeta();
 ItemStack armament = new ItemStack(Material.IRON_INGOT);
 ItemMeta armamentMeta = armament.getItemMeta();
 ItemStack observation = new ItemStack(Material.NETHER_STAR);
 ItemMeta observationMeta = observation.getItemMeta();
 ItemStack conqueror = new ItemStack(Material.BLAZE_ROD);
 ItemMeta conquerorMeta = observation.getItemMeta();

 SkullMeta skullMeta = (SkullMeta) skull.getItemMeta();
 skullMeta.setOwner(p.getName());
 skullMeta.setDisplayName(ChatColor.GOLD + p.getName() + "'s Stats");
 skull.setItemMeta(skullMeta);
 
 classNameMeta.setDisplayName(ChatColor.GOLD + "Class: " + ChatColor.BLUE + Datafiles.getClass(p.getName()));
 className.setItemMeta(classNameMeta);
 
 killsMeta.setDisplayName(ChatColor.GOLD + "Kills: " + ChatColor.BLUE + Datafiles.getKills(p.getName()));
 kills.setItemMeta(killsMeta);
 
 deathsMeta.setDisplayName(ChatColor.GOLD + "Deaths: " + ChatColor.BLUE + Datafiles.getDeaths(p.getName()));
 deaths.setItemMeta(deathsMeta);
 
 
 armamentMeta.setDisplayName(ChatColor.GOLD + "Armament Haki");
// armamentMeta.setLore(armamentLore);
 armament.setItemMeta(armamentMeta);
 
 observationMeta.setDisplayName(ChatColor.GOLD + "Observation Haki");
 //observationMeta.setLore(observationLore);
 observation.setItemMeta(observationMeta);
 
 conquerorMeta.setDisplayName(ChatColor.GOLD + "Conqueror Haki");
 // conquerorMeta.setLore(conquerorLore);
 conqueror.setItemMeta(conquerorMeta);
 
 inv.setItem(0, skull);
 inv.setItem(9, className);
 inv.setItem(4, kills);
 inv.setItem(13, deaths);
 inv.setItem(8, armament);
 inv.setItem(17, observation);
 inv.setItem(26, conqueror);

 
 p.openInventory(inv);
}
 
開發者ID:MohibMirza,項目名稱:RPGPlus,代碼行數:69,代碼來源:StatsGUI.java

示例4: CustomCrafting

public CustomCrafting(String name) {
	this.name = name;
	
	//System.out.println(makeCrafter[0]);
	
	makeCrafter[4] = new ItemStack(Material.IRON_INGOT);
}
 
開發者ID:GigaGamma,項目名稱:SuperiorCraft,代碼行數:7,代碼來源:CustomCrafting.java


注:本文中的org.bukkit.Material.IRON_INGOT屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。