当前位置: 首页>>代码示例>>Java>>正文


Java Material.LEATHER_BOOTS属性代码示例

本文整理汇总了Java中org.bukkit.Material.LEATHER_BOOTS属性的典型用法代码示例。如果您正苦于以下问题:Java Material.LEATHER_BOOTS属性的具体用法?Java Material.LEATHER_BOOTS怎么用?Java Material.LEATHER_BOOTS使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.bukkit.Material的用法示例。


在下文中一共展示了Material.LEATHER_BOOTS属性的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: isApplicableFor

public boolean isApplicableFor(Player player)
{
    PlayerInventory playerInventory = player.getInventory();
    ItemStack helmet = playerInventory.getHelmet();
    if ((helmet == null) || (helmet.getType() != Material.LEATHER_HELMET)) {
        return false;
    }
    ItemStack chestplate = playerInventory.getChestplate();
    if ((chestplate == null) || (chestplate.getType() != Material.LEATHER_CHESTPLATE)) {
        return false;
    }
    ItemStack leggings = playerInventory.getLeggings();
    if ((leggings == null) || (leggings.getType() != Material.LEATHER_LEGGINGS)) {
        return false;
    }
    ItemStack boots = playerInventory.getBoots();
    return (boots != null) && (boots.getType() == Material.LEATHER_BOOTS);
}
 
开发者ID:funkemunky,项目名称:HCFCore,代码行数:18,代码来源:ArcherClass.java

示例2: placeBlock

public ArmorStand placeBlock(Location l) {
	ArmorStand block = (ArmorStand) l.getWorld().spawnEntity(l, EntityType.ARMOR_STAND);
	block.setSmall(true);
	block.setGravity(false);
	block.setCustomName("CustomBlock");
	block.setCustomNameVisible(false);
	block.setInvulnerable(true);
	block.setVisible(false);
	block.setMarker(true);
	block.setSilent(true);
	
	ItemStack a = new ItemStack(Material.LEATHER_BOOTS);
	a.setDurability((short) primary.getTexture());
	LeatherArmorMeta am = (LeatherArmorMeta) a.getItemMeta();
	am.setColor(primary.getColor());
	am.setUnbreakable(true);
	if (primary.isGlowing()) {
		am.addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 3, true);
	}
	a.setItemMeta(am);
	block.setHelmet(a);
	
	if (secondary != null) {
		ItemStack b = new ItemStack(Material.LEATHER_BOOTS);
		b.setDurability((short) secondary.getTexture());
		LeatherArmorMeta bm = (LeatherArmorMeta) b.getItemMeta();
		bm.setColor(secondary.getColor());
		bm.setUnbreakable(true);
		if (secondary.isGlowing()) {
			System.out.println("H");
			bm.addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 3, true);
		}
		b.setItemMeta(bm);
		block.getEquipment().setItemInMainHand(b);
	}
	
	return block;
}
 
开发者ID:GigaGamma,项目名称:SuperiorCraft,代码行数:38,代码来源:CustomBlockTexture.java

示例3: isPieceOfArmor

private static boolean isPieceOfArmor(ItemStack stack)
{
    if (stack.getType() == Material.LEATHER_HELMET || stack.getType() == Material.LEATHER_CHESTPLATE || stack.getType() == Material.LEATHER_LEGGINGS || stack.getType() == Material.LEATHER_BOOTS)
        return true;
    else if (stack.getType() == Material.IRON_HELMET || stack.getType() == Material.IRON_CHESTPLATE || stack.getType() == Material.IRON_LEGGINGS || stack.getType() == Material.IRON_BOOTS)
        return true;
    else if (stack.getType() == Material.CHAINMAIL_HELMET || stack.getType() == Material.CHAINMAIL_CHESTPLATE || stack.getType() == Material.CHAINMAIL_LEGGINGS || stack.getType() == Material.CHAINMAIL_BOOTS)
        return true;
    else if (stack.getType() == Material.GOLD_HELMET || stack.getType() == Material.GOLD_CHESTPLATE || stack.getType() == Material.GOLD_LEGGINGS || stack.getType() == Material.GOLD_BOOTS)
        return true;
    else if (stack.getType() == Material.DIAMOND_HELMET || stack.getType() == Material.DIAMOND_CHESTPLATE || stack.getType() == Material.DIAMOND_LEGGINGS || stack.getType() == Material.DIAMOND_BOOTS)
        return true;

    return false;
}
 
开发者ID:SamaGames,项目名称:Hub,代码行数:15,代码来源:PlayerProtectionListener.java

示例4: onCraftItem

@EventHandler(priority = EventPriority.HIGH)
public void onCraftItem(CraftItemEvent event) 
{
	if( event.getRecipe().getResult().getType() == Material.STONE_SWORD
			|| event.getRecipe().getResult().getType() == Material.IRON_SWORD
			|| event.getRecipe().getResult().getType() == Material.GOLD_SWORD
			|| event.getRecipe().getResult().getType() == Material.DIAMOND_SWORD
|| event.getRecipe().getResult().getType() == Material.LEATHER_BOOTS
			|| event.getRecipe().getResult().getType() == Material.LEATHER_LEGGINGS
			|| event.getRecipe().getResult().getType() == Material.LEATHER_CHESTPLATE
			|| event.getRecipe().getResult().getType() == Material.LEATHER_HELMET
|| event.getRecipe().getResult().getType() == Material.CHAINMAIL_BOOTS
			|| event.getRecipe().getResult().getType() == Material.CHAINMAIL_LEGGINGS
			|| event.getRecipe().getResult().getType() == Material.CHAINMAIL_CHESTPLATE
			|| event.getRecipe().getResult().getType() == Material.CHAINMAIL_HELMET
|| event.getRecipe().getResult().getType() == Material.GOLD_BOOTS
			|| event.getRecipe().getResult().getType() == Material.GOLD_LEGGINGS
			|| event.getRecipe().getResult().getType() == Material.GOLD_CHESTPLATE
			|| event.getRecipe().getResult().getType() == Material.GOLD_HELMET
			|| event.getRecipe().getResult().getType() == Material.IRON_BOOTS
			|| event.getRecipe().getResult().getType() == Material.IRON_LEGGINGS
			|| event.getRecipe().getResult().getType() == Material.IRON_CHESTPLATE
			|| event.getRecipe().getResult().getType() == Material.IRON_HELMET
			|| event.getRecipe().getResult().getType() == Material.DIAMOND_BOOTS
			|| event.getRecipe().getResult().getType() == Material.DIAMOND_LEGGINGS
			|| event.getRecipe().getResult().getType() == Material.DIAMOND_CHESTPLATE
			|| event.getRecipe().getResult().getType() == Material.DIAMOND_HELMET)
	{
		if( event.getWhoClicked().getType() == EntityType.PLAYER )
		{
			Player p = (Player)event.getWhoClicked();
			p.sendMessage("Sorry, you are not allowed to craft this item. Purchase it from a Safe Dock instead.");
		}
		event.setCancelled(false);
	}
 
}
 
开发者ID:Maximuspayne,项目名称:NavyCraft2-Lite,代码行数:37,代码来源:NavyCraft_InventoryListener.java

示例5: setArmourColour

public static ItemStack setArmourColour(ItemStack i, Color c) {
	Material t = i.getType();
	if (!(t == Material.LEATHER_HELMET || t == Material.LEATHER_CHESTPLATE || t == Material.LEATHER_LEGGINGS
			|| t == Material.LEATHER_BOOTS)) {
		return i;
	}
	LeatherArmorMeta m = (LeatherArmorMeta) i.getItemMeta();
	m.setColor(c);
	i.setItemMeta(m);
	i = applyItemFlags(i);
	return i;
}
 
开发者ID:jusjus112,项目名称:OnlineChecker-Spigot-SQL-Support,代码行数:12,代码来源:UtilItem.java

示例6: setWardenInv

private void setWardenInv(Player target) throws SQLException {
    RankManager.setGuardLevel(target, 2);
    RankManager.setWantedLevel(target, 0);
    target.getInventory().clear();

    ItemStack boots = new ItemStack(Material.LEATHER_BOOTS);
    LeatherArmorMeta bootsMeta = (LeatherArmorMeta)boots.getItemMeta();
    bootsMeta.setColor(Color.fromRGB(224, 33, 15));
    boots.setItemMeta(bootsMeta);
    target.getInventory().setBoots(boots);

    ItemStack leggings = new ItemStack(Material.LEATHER_LEGGINGS);
    LeatherArmorMeta leggingsMeta = (LeatherArmorMeta)leggings.getItemMeta();
    leggingsMeta.setColor(Color.fromRGB(224, 33, 15));
    leggings.setItemMeta(leggingsMeta);
    target.getInventory().setLeggings(leggings);

    ItemStack chest = new ItemStack(Material.LEATHER_CHESTPLATE);
    LeatherArmorMeta chestMeta = (LeatherArmorMeta)chest.getItemMeta();
    chestMeta.setColor(Color.fromRGB(224, 33, 15));
    chest.setItemMeta(chestMeta);
    target.getInventory().setChestplate(chest);

    ItemStack helmet = new ItemStack(Material.LEATHER_HELMET);
    LeatherArmorMeta helmetMeta = (LeatherArmorMeta)helmet.getItemMeta();
    helmetMeta.setColor(Color.fromRGB(224, 33, 15));
    helmet.setItemMeta(helmetMeta);
    target.getInventory().setHelmet(helmet);
    try{
        ScrapsUtil.setScraps(target, ScrapsUtil.getScraps(target));
    } catch(SQLException e){
        e.printStackTrace();
    }
}
 
开发者ID:Warvale,项目名称:Locked,代码行数:34,代码来源:SetStatusCommand.java

示例7: setGuardInv

private void setGuardInv(Player target) throws SQLException {
    RankManager.setGuardLevel(target, 1);
    RankManager.setWantedLevel(target, 0);
    target.getInventory().clear();

    ItemStack boots = new ItemStack(Material.LEATHER_BOOTS);
    LeatherArmorMeta bootsMeta = (LeatherArmorMeta)boots.getItemMeta();
    bootsMeta.setColor(Color.fromRGB(145, 0, 0));
    boots.setItemMeta(bootsMeta);
    target.getInventory().setBoots(boots);

    ItemStack leggings = new ItemStack(Material.LEATHER_LEGGINGS);
    LeatherArmorMeta leggingsMeta = (LeatherArmorMeta)leggings.getItemMeta();
    leggingsMeta.setColor(Color.fromRGB(145, 0, 0));
    leggings.setItemMeta(leggingsMeta);
    target.getInventory().setLeggings(leggings);

    ItemStack chest = new ItemStack(Material.LEATHER_CHESTPLATE);
    LeatherArmorMeta chestMeta = (LeatherArmorMeta)chest.getItemMeta();
    chestMeta.setColor(Color.fromRGB(145, 0, 0));
    chest.setItemMeta(chestMeta);
    target.getInventory().setChestplate(chest);

    ItemStack helmet = new ItemStack(Material.LEATHER_HELMET);
    LeatherArmorMeta helmetMeta = (LeatherArmorMeta)helmet.getItemMeta();
    helmetMeta.setColor(Color.fromRGB(145, 0, 0));
    helmet.setItemMeta(helmetMeta);
    target.getInventory().setHelmet(helmet);
}
 
开发者ID:Warvale,项目名称:Locked,代码行数:29,代码来源:SetStatusCommand.java

示例8: onInventoryClick

@EventHandler
public void onInventoryClick(InventoryClickEvent event)
{
    if (event.getClickedInventory() != null && event.getCurrentItem() != null)
    {
        if (event.getCurrentItem().getType() == Material.LEATHER_BOOTS || event.getCurrentItem().getType() == Material.IRON_BOOTS || event.getCurrentItem().getType() == Material.CHAINMAIL_BOOTS || event.getCurrentItem().getType() == Material.GOLD_BOOTS || event.getCurrentItem().getType() == Material.DIAMOND_BOOTS)
        {
            if ((event.getClickedInventory().getType() == InventoryType.ENCHANTING || event.getClickedInventory().getType() == InventoryType.ANVIL) && event.getSlot() == 0)
                event.getCurrentItem().removeEnchantment(Enchantment.DEPTH_STRIDER);
            else if (event.getClickedInventory().getType() == InventoryType.ANVIL && event.getSlot() == 2)
                event.getCurrentItem().addEnchantment(Enchantment.DEPTH_STRIDER, 2);
        }
    }
}
 
开发者ID:SamaGames,项目名称:DoubleRunner,代码行数:14,代码来源:DoubleRunnerGameLoop.java

示例9: create

public static PigZombie create(Location l) {
	PigZombie police = (PigZombie) l.getWorld().spawnEntity(l, EntityType.PIG_ZOMBIE);
	Pig hov = (Pig) l.getWorld().spawnEntity(l, EntityType.PIG);
	
	police.setMaxHealth(80);
	police.setHealth(80);
	
	ItemStack helm = new ItemStack(Material.LEATHER_HELMET);
	LeatherArmorMeta helmMeta = (LeatherArmorMeta) helm.getItemMeta();
	helmMeta.setColor(Color.BLACK);
	helmMeta.setDisplayName(ChatColor.BOLD + "Bullet Proof Helmet");
	helmMeta.addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 3, true);
	
	helm.setItemMeta(helmMeta);
	
	ItemStack chest = new ItemStack(Material.LEATHER_CHESTPLATE);
	LeatherArmorMeta chestMeta = (LeatherArmorMeta) chest.getItemMeta();
	chestMeta.setColor(Color.BLACK);
	chestMeta.setDisplayName(ChatColor.BOLD + "Bullet Proof Vest");
	chestMeta.addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 3, true);

	chest.setItemMeta(chestMeta);
	
	ItemStack leg = new ItemStack(Material.LEATHER_LEGGINGS);
	LeatherArmorMeta legMeta = (LeatherArmorMeta) leg.getItemMeta();
	legMeta.setColor(Color.BLACK);
	legMeta.setDisplayName(ChatColor.BOLD + "Bullet Proof Leggings");
	legMeta.addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 3, true);
	
	leg.setItemMeta(legMeta);
	
	ItemStack boots = new ItemStack(Material.LEATHER_BOOTS);
	LeatherArmorMeta bootsMeta = (LeatherArmorMeta) boots.getItemMeta();
	bootsMeta.setColor(Color.BLACK);
	bootsMeta.setDisplayName(ChatColor.BOLD + "Bullet Proof Boots");
	bootsMeta.addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 3, true);
	bootsMeta.addEnchant(Enchantment.PROTECTION_FALL, 15, true);
	
	boots.setItemMeta(bootsMeta);
	
	EntityEquipment ee = police.getEquipment();
	
	ee.setHelmet(helm);
	ee.setChestplate(chest);
	ee.setLeggings(leg);
	ee.setBoots(boots);
	
	ee.setItemInOffHand(new ItemStack(Material.CARROT_STICK));
	
	police.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, Integer.MAX_VALUE, 1, true, false));
	hov.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, Integer.MAX_VALUE, 4, true, false));
	
	hov.setPassenger(police);
	
	police.setCustomName("Officer");
	police.setCustomNameVisible(true);
	police.addScoreboardTag("law");
	
	
	return police;
}
 
开发者ID:GigaGamma,项目名称:SuperiorCraft,代码行数:61,代码来源:Police.java

示例10: isDressed

public boolean isDressed(Player p)
{
 if( this.type.canFly )
 {
   if( p.getInventory().getHelmet() != null && p.getInventory().getHelmet().getType() == Material.CHAINMAIL_HELMET )
{
   	if( p.getInventory().getChestplate() != null && p.getInventory().getChestplate().getType() == Material.CHAINMAIL_CHESTPLATE )
	{
   		if( p.getInventory().getLeggings() != null && p.getInventory().getLeggings().getType() == Material.CHAINMAIL_LEGGINGS )
		{
   			if( p.getInventory().getBoots() != null && p.getInventory().getBoots().getType() == Material.CHAINMAIL_BOOTS )
			{
   				return true;
			}	
		}	
	}	
}
   p.sendMessage(ChatColor.RED + "You need to wear pilot (chainmail) uniform to use this.");
   return false;
 }else if( this.type.isTerrestrial)
 {
  if( p.getInventory().getHelmet() != null && p.getInventory().getHelmet().getType() == Material.IRON_HELMET )
{
   	if( p.getInventory().getChestplate() != null && p.getInventory().getChestplate().getType() == Material.IRON_CHESTPLATE )
	{
   		if( p.getInventory().getLeggings() != null && p.getInventory().getLeggings().getType() == Material.IRON_LEGGINGS )
		{
   			if( p.getInventory().getBoots() != null && p.getInventory().getBoots().getType() == Material.IRON_BOOTS )
			{
   				return true;
			}	
		}	
	}	
}
   p.sendMessage(ChatColor.RED + "You need to wear soldier (iron) uniform to use this.");
   return false;  
 }else
 {
  if( p.getInventory().getHelmet() != null && (p.getInventory().getHelmet().getType() == Material.LEATHER_HELMET || p.getInventory().getHelmet().getType() == Material.GOLD_HELMET || p.getInventory().getHelmet().getType() == Material.DIAMOND_HELMET) )
{
   	if( p.getInventory().getChestplate() != null && (p.getInventory().getChestplate().getType() == Material.LEATHER_CHESTPLATE || p.getInventory().getChestplate().getType() == Material.GOLD_CHESTPLATE || p.getInventory().getChestplate().getType() == Material.DIAMOND_CHESTPLATE) )
	{
   		if( p.getInventory().getLeggings() != null && (p.getInventory().getLeggings().getType() == Material.LEATHER_LEGGINGS || p.getInventory().getLeggings().getType() == Material.GOLD_LEGGINGS || p.getInventory().getLeggings().getType() == Material.DIAMOND_LEGGINGS) )
		{
   			if( p.getInventory().getBoots() != null && (p.getInventory().getBoots().getType() == Material.LEATHER_BOOTS || p.getInventory().getBoots().getType() == Material.GOLD_BOOTS || p.getInventory().getBoots().getType() == Material.DIAMOND_BOOTS) )
			{
   				return true;
			}	
		}	
	}	
}
   p.sendMessage(ChatColor.RED + "You need to wear sailor (leather) or captain (gold) uniform to use this.");
   return false;  
 }
}
 
开发者ID:Maximuspayne,项目名称:NavyCraft2-Lite,代码行数:55,代码来源:Craft.java

示例11: onEnchantItem

@EventHandler
public void onEnchantItem(EnchantItemEvent event)
{
    if (event.getItem().getType() == Material.LEATHER_BOOTS || event.getItem().getType() == Material.IRON_BOOTS || event.getItem().getType() == Material.CHAINMAIL_BOOTS || event.getItem().getType() == Material.GOLD_BOOTS || event.getItem().getType() == Material.DIAMOND_BOOTS)
        event.getItem().addEnchantment(Enchantment.DEPTH_STRIDER, 2);
}
 
开发者ID:SamaGames,项目名称:DoubleRunner,代码行数:6,代码来源:DoubleRunnerGameLoop.java


注:本文中的org.bukkit.Material.LEATHER_BOOTS属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。