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


Java Material.EMERALD属性代码示例

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


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

示例1: setVale

public static void setVale(Player player, int amount) throws SQLException {
    UUID uuid = player.getUniqueId();
    PreparedStatement stmt = plugin.getDb().getConnection().prepareStatement("UPDATE vale_eco SET amount = "+amount+" WHERE uuid = '"+uuid.toString()+"'");
    stmt.executeUpdate();

    ItemStack item = new ItemStack(Material.EMERALD, 1);
    ItemMeta meta = item.getItemMeta();
    meta.setDisplayName(ChatColor.GREEN.toString() + getVale(player) + (getVale(player)==1?" Vale":" Vales"));
    meta.addEnchant(Enchantment.LUCK, 1, true);
    meta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
    item.setItemMeta(meta);
    if(plugin.getConfig().getString("valeitemininv").equals("true")){
        player.getInventory().setItem(8, item);
    }

}
 
开发者ID:Warvale,项目名称:NetworkCore,代码行数:16,代码来源:ValeUtil.java

示例2: testisSpaceAvailabletrue

@Test
public void testisSpaceAvailabletrue()
{
    PlayerInventory pi = mock(PlayerInventory.class);
    doReturn(pi).when(player).getInventory();
    ItemStack itemStack = new ItemStack(Material.EMERALD);
    assertTrue(Util.isSpaceAvailable(player, itemStack));
}
 
开发者ID:ThePhilderbeast,项目名称:prisonPicks,代码行数:8,代码来源:UtilTest.java

示例3: testisSpaceAvailablefalse

@Test
public void testisSpaceAvailablefalse()
{
    Player player = spy(Player.class);
    PlayerInventory pi = mock(PlayerInventory.class);
    when(player.getInventory()).thenReturn(pi);
    when(pi.getItem(anyInt())).thenReturn(new ItemStack(Material.GRASS));

    ItemStack itemStack = new ItemStack(Material.EMERALD);
    assertFalse(Util.isSpaceAvailable(player, itemStack));
}
 
开发者ID:ThePhilderbeast,项目名称:prisonPicks,代码行数:11,代码来源:UtilTest.java

示例4: load

public void load() {
	// Power Crystal
	
	ItemStack pcrys = new ItemStack(Material.DIAMOND);
   	ItemMeta pcrysm = pcrys.getItemMeta();
   	pcrysm.setDisplayName("&b&lPower Crystal".replace('&', '�'));
   	ArrayList<String> pcrysl = new ArrayList<String>();
   	pcrysl.add("&b&l0 / 100,000 RF".replace('&', '�'));
      	pcrysm.setLore(pcrysl);
      	pcrys.addUnsafeEnchantment(Enchantment.DAMAGE_ALL, 100);
   	pcrys.setItemMeta(pcrysm);
	
	CustomItem pc = new PowerCrystal(pcrys, "superiorcraft:power_crystal");
	
	SuperiorCraft.plugin.getServer().getPluginManager().registerEvents(pc, SuperiorCraft.plugin);
	
	// Uranium Ingot
	
	ItemStack uing = new ItemStack(Material.EMERALD);
   	ItemMeta uingm = uing.getItemMeta();
   	uingm.setDisplayName("&2Uranium Ingot".replace('&', '�'));
   	ArrayList<String> uingl = new ArrayList<String>();
   	uingl.add("&2A radioactive material".replace('&', '�'));
      	uingm.setLore(uingl);
      	uing.addUnsafeEnchantment(Enchantment.DAMAGE_ALL, 100);
   	uing.setItemMeta(uingm);
	
	CustomItem ui = new UraniumIngot(uing, "more:uranium_ingot");
	SuperiorCraft.plugin.getServer().getPluginManager().registerEvents(ui, SuperiorCraft.plugin);
}
 
开发者ID:GigaGamma,项目名称:SuperiorCraft,代码行数:30,代码来源:CustomItem.java

示例5: getBackIcon

protected static ItemStack getBackIcon()
{
    ItemStack stack = new ItemStack(Material.EMERALD, 1);
    ItemMeta meta = stack.getItemMeta();
    meta.setDisplayName(ChatColor.GREEN + "« Retour");
    stack.setItemMeta(meta);

    return stack;
}
 
开发者ID:SamaGames,项目名称:Hub,代码行数:9,代码来源:AbstractGui.java

示例6: onBlockDispense

@EventHandler(priority = EventPriority.HIGH)
public void onBlockDispense(final BlockDispenseEvent event) {
	if (!event.isCancelled()) {
		if (PermissionInterface.CheckEnabledWorld(event.getBlock().getLocation()) && (event.getItem().getType() == Material.EMERALD)) {
			event.setCancelled(true);
		}

	}
	
	if(!event.isCancelled())
		AimCannonPlayerListener.onBlockDispense(event);
}
 
开发者ID:Maximuspayne,项目名称:NavyCraft2-Lite,代码行数:12,代码来源:NavyCraft_BlockListener.java

示例7: getPlaceholder7

/**
 * l.add("��9��һҳ");
 * @return ��һҳ
 */
public static ItemStack getPlaceholder7(){
	ItemStack sw=new ItemStack(Material.EMERALD);
	ItemMeta im = sw.getItemMeta();
	im.setDisplayName("��9��l��һҳ");
	List<String> l=new LinkedList<String>();
	l.add("��9��һ������");
	im.setLore(l);
	sw.setItemMeta(im);
	return sw;
}
 
开发者ID:SchoolUniform,项目名称:RealSurvival,代码行数:14,代码来源:Items.java

示例8: onCompassClick

@EventHandler
public void onCompassClick(PlayerInteractEvent event) {
	if (event.getItem() == null || event.getItem().getType() != Material.EMERALD)
		return;
	Player p = event.getPlayer();
	ItemStack stack = event.getItem();
	if (stack.getItemMeta().hasDisplayName()) {
		String display = Chat.stripColor(stack.getItemMeta().getDisplayName());
		if (display.equalsIgnoreCase("voting panel")) {
			new VotePanel(p).show();
		}
	}
}
 
开发者ID:thekeenant,项目名称:mczone,代码行数:13,代码来源:VotePanelEvents.java

示例9: 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

示例10: customDeath

@EventHandler(priority=EventPriority.HIGHEST)
public void customDeath(EntityDamageByEntityEvent e){
	if(e.isCancelled())return;
	if(e.getEntity() instanceof Player && e.getDamager() instanceof Player){
		Player p = (Player) e.getEntity();
		if(e.getFinalDamage() >= p.getHealth()){
			Player killer = (Player) e.getDamager();
			String uuid2 = killer.getUniqueId().toString();
			e.setCancelled(true);
			if(! p.getName().equals(killer.getName())){ // if they were killed by someone else, not themselves
				setTokens(uuid2, getTokens(uuid2)+2);
				killer.sendMessage(tag + ChatColor.BLUE + "You have received " + ChatColor.GOLD + "2" +
						ChatColor.BLUE + " tokens for killing " + p.getName());
			}
			Bukkit.getServer().broadcastMessage(ChatColor.GRAY + killer.getName() + " destroyed " + p.getName());
			// Set statistics
			//killer.setStatistic(Statistic.KILL_ENTITY, killer.getStatistic(Statistic.KILL_ENTITY) + 1);
			//p.setStatistic(Statistic.DEATHS, p.getStatistic(Statistic.DEATHS) + 1);
			// Reset health, so they dont die
			p.setHealth(p.getMaxHealth());
			// Inventory clearing
			p.getInventory().clear();
			ItemStack air = new ItemStack(Material.AIR);
			p.getInventory().setHelmet(air);
			p.getInventory().setChestplate(air);
			p.getInventory().setLeggings(air);
			p.getInventory().setBoots(air);
			// Drop emerald at death location
			ItemStack reward = new ItemStack(Material.EMERALD);
			p.getWorld().dropItemNaturally(p.getLocation(), reward);
			// Clear potion effects
			for(PotionEffect pe : p.getActivePotionEffects()){
				p.removePotionEffect(pe.getType());
			}
			// Stop infinite kill glitch
			p.setGameMode(GameMode.SPECTATOR);
			p.setGameMode(GameMode.ADVENTURE);
			// Send them to the SPAWN of the world
			p.teleport(p.getWorld().getSpawnLocation());
			p.setFireTicks(0);
		}
	}
}
 
开发者ID:OverloadedCore,项目名称:kaosEssentials,代码行数:43,代码来源:Core.java


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