当前位置: 首页>>代码示例>>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;未经允许,请勿转载。