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


Java Material.ARROW属性代码示例

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


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

示例1: pending

public static Inventory pending(Player player) {
	Inventory i = Bukkit.createInventory(null, 54, Messager.color("&cPending Ban Requests"));
	
	ItemStack back = new ItemStack(Material.ARROW);
	ItemMeta im = back.getItemMeta();
	im.setDisplayName(Messager.color("&cBack"));
	back.setItemMeta(im);		
	i.setItem(45, back);
	
	int tillFull = 0;
	
	for (int x = 0; x <= Main.getInstance().getConfig().getInt("current_id"); x++) {			
		if (tillFull >= 53) {
			Messager.msgPlayer("&cAll of the requests could not fit in the GUI. Please accept or deny some requests.", player);
			break;
		}
		BanRequest br = new BanRequest(x);
		if (!br.closed) {
			i.addItem(br.getItem());
			tillFull++;
		}
	}
	
	return i;		
}
 
开发者ID:JustBru00,项目名称:EpicBanRequests,代码行数:25,代码来源:GUIManager.java

示例2: archived

public static Inventory archived(Player player) {
	Inventory i = Bukkit.createInventory(null, 54, Messager.color("&7Archived Requests"));
	
	
	ItemStack back = new ItemStack(Material.ARROW);
	ItemMeta im = back.getItemMeta();
	im.setDisplayName(Messager.color("&cBack"));
	back.setItemMeta(im);		
	i.setItem(45, back);
	
	int tillFull = 0;
	for (int x = Main.getInstance().getConfig().getInt("current_id"); x <= 0; x--) {	
		
		if (tillFull >= 53) {
			Messager.msgPlayer("&cAll of the archived requests could not fit in the GUI. Showing the newest first.", player);
			break;
		}
		BanRequest br = new BanRequest(x);
		if (br.closed) {
			i.addItem(br.getArchivedItem());
			tillFull++;
		}
	}
	
	return i;
}
 
开发者ID:JustBru00,项目名称:EpicBanRequests,代码行数:26,代码来源:GUIManager.java

示例3: bowEnchantGUI

public static void bowEnchantGUI(Player player){
    bowGUI = Bukkit.createInventory(null, 9, ChatColor.DARK_GRAY + " Bow Enchantments");

    ItemStack filler = new ItemStack(Material.STAINED_GLASS_PANE, 1, (short) 7);
    ItemMeta fillerMeta = filler.getItemMeta();
    fillerMeta.setDisplayName(ChatColor.GRAY + "");
    filler.setItemMeta(fillerMeta);

    ItemStack back = new ItemStack(Material.ARROW);
    ItemMeta backMeta = back.getItemMeta();
    backMeta.setDisplayName(ChatColor.RED + "Previous");
    back.setItemMeta(backMeta);

    ItemStack empty = new ItemStack(Material.BARRIER);
    ItemMeta emptyMeta = empty.getItemMeta();
    emptyMeta.setDisplayName(ChatColor.RED + "There are currently no bow enchants!");
    empty.setItemMeta(emptyMeta);

    bowGUI.setItem(0, filler);
    bowGUI.setItem(1, filler);
    bowGUI.setItem(2, filler);
    bowGUI.setItem(3, filler);
    bowGUI.setItem(4, empty);
    bowGUI.setItem(5, filler);
    bowGUI.setItem(6, filler);
    bowGUI.setItem(7, filler);
    bowGUI.setItem(8, back);

    player.openInventory(bowGUI);
}
 
开发者ID:Warvale,项目名称:Scorch,代码行数:30,代码来源:EnchantsCommand.java

示例4: armorEnchantGUI

public static void armorEnchantGUI(Player player){
    armorGUI = Bukkit.createInventory(null, 9, ChatColor.DARK_GRAY + "Armor Enchantments");

    ItemStack filler = new ItemStack(Material.STAINED_GLASS_PANE, 1, (short) 7);
    ItemMeta fillerMeta = filler.getItemMeta();
    fillerMeta.setDisplayName(ChatColor.GRAY + "");
    filler.setItemMeta(fillerMeta);

    ItemStack back = new ItemStack(Material.ARROW);
    ItemMeta backMeta = back.getItemMeta();
    backMeta.setDisplayName(ChatColor.RED + "Previous");
    back.setItemMeta(backMeta);

    ItemStack lifeEssence = new ItemStack(Material.POTION);
    ItemMeta lifeEssenceMeta = lifeEssence.getItemMeta();
    lifeEssenceMeta.setDisplayName(ChatColor.RED + "Life Essence");
    lifeEssenceMeta.setLore(Arrays.asList(ChatColor.GRAY + Main.getEnchantment("Life Essence").getDescription(), ChatColor.GRAY + "Rarity: " + Main.getEnchantment("Life Essence").getRarity().getName()));
    lifeEssence.setItemMeta(lifeEssenceMeta);

    ItemStack endurance = new ItemStack(Material.SHIELD);
    ItemMeta enduranceMeta = endurance.getItemMeta();
    enduranceMeta.setDisplayName(ChatColor.GOLD + "Endurance");
    enduranceMeta.setLore(Arrays.asList(ChatColor.GRAY + Main.getEnchantment("Endurance").getDescription(), ChatColor.GRAY + "Rarity: " + Main.getEnchantment("Endurance").getRarity().getName()));
    endurance.setItemMeta(enduranceMeta);

    armorGUI.setItem(0, filler);
    armorGUI.setItem(1, filler);
    armorGUI.setItem(2, filler);
    armorGUI.setItem(3, lifeEssence);
    armorGUI.setItem(4, filler);
    armorGUI.setItem(5, endurance);
    armorGUI.setItem(6, filler);
    armorGUI.setItem(7, filler);
    armorGUI.setItem(8, back);

    player.openInventory(armorGUI);
}
 
开发者ID:Warvale,项目名称:Scorch,代码行数:37,代码来源:EnchantsCommand.java

示例5: onShootWithoutArrows

@SuppressWarnings("deprecation")
@EventHandler
public void onShootWithoutArrows(EntityShootBowEvent event)
{
	if(event.getEntity() instanceof Player)
	{
		Player player = (Player)event.getEntity();
		if(player.getInventory().getItemInMainHand().getType() == event.getBow().getType())
		{
			if
			(
				player.getInventory().getItemInOffHand().getType() == Material.ARROW
				|| player.getInventory().getItemInOffHand().getType() == Material.SPECTRAL_ARROW
				|| player.getInventory().getItemInOffHand().getType() == Material.TIPPED_ARROW
			)
			{
				event.setCancelled(false);
			}
			else
			{
				event.setCancelled(true);
				player.sendMessage(ChatColor.RED + Survival.Words.get("Must load Arrows on off hand"));
				player.updateInventory();
			}
		}
		else
		{
			event.setCancelled(true);
			player.sendMessage(ChatColor.RED + Survival.Words.get("Must use a Bow with main hand"));
			player.updateInventory();
		}
	}
}
 
开发者ID:FattyMieo,项目名称:SurvivalPlus,代码行数:33,代码来源:Bow.java

示例6: anvilStuff

@SuppressWarnings("deprecation")
@EventHandler
public void anvilStuff(PlayerInteractEvent e){
	if(e.getClickedBlock() == null)return;
	if(e.getClickedBlock().getType().equals(Material.ANVIL)){
		e.setCancelled(true);
		Player p = e.getPlayer();
		String uuid = p.getUniqueId().toString();
		long tokens = getTokens(uuid);
		if(p.getItemInHand().getType() == Material.AIR ||
				p.getItemInHand().getType() == Material.GOLDEN_APPLE ||
				p.getItemInHand().getType() == Material.ARROW ||
				p.getItemInHand().getType() == Material.POTION){
			
			p.sendMessage(tag + ChatColor.RED + "You can\'t repair that!");
		}else{
			if(tokens < 1){
				p.sendMessage(tag + ChatColor.RED + "You need at least 1 token to repair things!!");
			}else{
				if(p.getItemInHand().getDurability() > 0){
					p.getItemInHand().setDurability((short) 0);
					setTokens(uuid, getTokens(uuid)-1);
					p.sendMessage(tag + ChatColor.BLUE + "Your item has been repaired");
				}else{
					p.sendMessage(tag + ChatColor.RED + "This item isn\'t broken");
				}
			}
		}
	}
}
 
开发者ID:OverloadedCore,项目名称:kaosEssentials,代码行数:30,代码来源:Core.java

示例7: openGUI

public void openGUI(Player player, int page) {
    Inventory inventory = Bukkit.createInventory(this, 54, I18n.format("user.select.gui.title"));
    int pageCount;
    pageCount = (spawnPoints.size() + 45 - 1) / 45;
    int offset = 0;
    if (page < 1 || page > pageCount) {
        page = 1;
    }
    if (page > 1) {
        offset = (page - 1) * (45);
    }
    setCurrentPage(page);
    for (int i = 0; i < 45; i++) {
        if (spawnPoints.size() > (offset + i)) {
            String spawnName = spawnPoints.getOrDefault(offset + i, null);
            if (spawnName != null) {
                ItemStack itemStack = new ItemStack(plugin.config.gui_item);
                addLore(plugin.config.spawnConfig.spawns.get(spawnName), itemStack);
                inventory.setItem(i, itemStack);
                continue;
            }
        }
        break;
    }
    if (page > 1) {
        ItemStack back = new ItemStack(Material.ARROW);
        ItemMeta backItemMeta = back.getItemMeta();
        backItemMeta.setDisplayName(I18n.format("user.info.back"));
        back.setItemMeta(backItemMeta);
        inventory.setItem(45, back);
    }
    if (page < pageCount) {
        ItemStack nextPage = new ItemStack(Material.ARROW);
        ItemMeta nextPageMeta = nextPage.getItemMeta();
        nextPageMeta.setDisplayName(I18n.format("user.info.next_page"));
        nextPage.setItemMeta(nextPageMeta);
        inventory.setItem(53, nextPage);
    }
    player.openInventory(inventory);
}
 
开发者ID:NyaaCat,项目名称:Ourtown,代码行数:40,代码来源:SpawnGUI.java

示例8: register

public void register() {
    ItemStack selector = new ItemStack(Material.ARROW);
    ItemMeta im = selector.getItemMeta();
    im.setDisplayName("§a前方射出的武器+1");
    selector.setItemMeta(im);
    this.setSelector(selector);
    this.setSkillType(SkillType.UPGRADE);
    SkillManager.getInstance().register(this);
    Bukkit.getPluginManager().registerEvents(this, Main.getInstance());
}
 
开发者ID:Soldier233,项目名称:ArchersBattle,代码行数:10,代码来源:MultiProjectile.java

示例9: meleeEnchantGUI

public static void meleeEnchantGUI(Player player){
    meleeGUI = Bukkit.createInventory(null, 9, ChatColor.DARK_GRAY + "Melee Enchantments");

    ItemStack filler = new ItemStack(Material.STAINED_GLASS_PANE, 1, (short) 7);
    ItemMeta fillerMeta = filler.getItemMeta();
    fillerMeta.setDisplayName(ChatColor.GRAY + "");
    filler.setItemMeta(fillerMeta);

    ItemStack back = new ItemStack(Material.ARROW);
    ItemMeta backMeta = back.getItemMeta();
    backMeta.setDisplayName(ChatColor.RED + "Previous");
    back.setItemMeta(backMeta);

    ItemStack thunderingStrike = new ItemStack(Material.BLAZE_ROD);
    ItemMeta thunderMeta = thunderingStrike.getItemMeta();
    thunderMeta.setDisplayName(ChatColor.GOLD + "Thundering Strike");
    thunderMeta.setLore(Arrays.asList(ChatColor.GRAY + Main.getEnchantment("Thundering Strike").getDescription(), ChatColor.GRAY + "Rarity: " + Main.getEnchantment("Thundering Strike").getRarity().getName()));
    thunderingStrike.setItemMeta(thunderMeta);

    ItemStack lifeSteal = new ItemStack(Material.FLINT);
    ItemMeta lifeStealMeta = lifeSteal.getItemMeta();
    lifeStealMeta.setDisplayName(ChatColor.RED + "Life Steal");
    lifeStealMeta.setLore(Arrays.asList(ChatColor.GRAY + Main.getEnchantment("Life Steal").getDescription(), ChatColor.GRAY + "Rarity: " + Main.getEnchantment("Life Steal").getRarity().getName()));
    lifeSteal.setItemMeta(lifeStealMeta);

    ItemStack lastHope = new ItemStack(Material.GHAST_TEAR);
    ItemMeta lastHopeMeta = lastHope.getItemMeta();
    lastHopeMeta.setDisplayName(ChatColor.LIGHT_PURPLE + "Last Hope");
    lastHopeMeta.setLore(Arrays.asList(ChatColor.GRAY + Main.getEnchantment("Last Hope").getDescription(), ChatColor.GRAY + "Rarity: " + Main.getEnchantment("Last Hope").getRarity().getName()));
    lastHope.setItemMeta(lastHopeMeta);

    ItemStack EXPSteal = new ItemStack(Material.EXP_BOTTLE);
    ItemMeta EXPStealMeta = EXPSteal.getItemMeta();
    EXPStealMeta.setDisplayName(ChatColor.GREEN + "Experience Steal");
    EXPStealMeta.setLore(Arrays.asList(ChatColor.GRAY + Main.getEnchantment("Experience Steal").getDescription(), ChatColor.GRAY + "Rarity: " + Main.getEnchantment("Experience Steal").getRarity().getName()));
    EXPSteal.setItemMeta(EXPStealMeta);

    meleeGUI.setItem(0, filler);
    meleeGUI.setItem(1, thunderingStrike);
    meleeGUI.setItem(2, filler);
    meleeGUI.setItem(3, lifeSteal);
    meleeGUI.setItem(4, filler);
    meleeGUI.setItem(5, lastHope);
    meleeGUI.setItem(6, filler);
    meleeGUI.setItem(7, EXPSteal);
    meleeGUI.setItem(8, back);

    player.openInventory(meleeGUI);
}
 
开发者ID:Warvale,项目名称:Scorch,代码行数:49,代码来源:EnchantsCommand.java

示例10: apply

@Override
public void apply( GUIContainer container ) {
    container.setSize( size );

    ArrayList<GUIContainer> subs = new ArrayList<>();

    for ( int i = invNum; i > 0; i-- ) {
        if ( i == invNum ) {
            subs.add( new GUISubContainer(plugin,container, null, container.getInventory().getTitle() + "| Seite: " + i, true, new PlainLayout( size, InventoryType.CHEST ) ) );
        } else if ( i <= 1 ) {
            subs.add( new GUISubContainer(plugin, container, (GUISubContainer) subs.get( subs.size() - 1 ), container.getInventory().getTitle() + "| Seite: 1", true, new PlainLayout( size, InventoryType.CHEST ) ) );
        } else {
            subs.add( new GUISubContainer(plugin,container, (GUISubContainer) subs.get( invNum - i - 1 ), container.getInventory().getTitle() + "| Seite: " + i, true, new PlainLayout( size, InventoryType.CHEST ) ) );
        }
    }


    subs.add( container );
    Collections.reverse( subs );

    Queue<GUIElement> elementQueue = Queues.newConcurrentLinkedQueue();
    elementQueue.addAll( elements );

    invQuery:
    for ( GUIContainer inv : subs ) {
        if ( inv.getInventory().firstEmpty() == -1 ) continue invQuery;


        for ( int y = 0; y < rows; y++ ) {
            for ( int x = 0; x < 9; x++ ) {
                GUIElement e = elementQueue.poll();
                if ( e == null ) break;
                e.setPosition( new Vector2i( x, y ) );
                inv.add( e );
            }
        }

        GUILabel label = new GUILabel( " ", Material.STAINED_GLASS_PANE, (byte) 7 );
        for ( int i = 0; i < 9; i++ ) {
            GUILabel clone = (GUILabel) label.clone();
            clone.setPosition( new Vector2i( i, rows ) );
            inv.add( clone );
        }

        if ( inv instanceof GUISubContainer ) {
            if ( ( (GUISubContainer) inv ).getParent() != null ) {
                ( (GUISubContainer) inv ).getExitButton().dispose();
                ( (GUISubContainer) inv ).getExitButton().setPosition( new Vector2i( 2, rows ) );
                ItemStack exit = new ItemStack( Material.ARROW );
                ItemMeta im = exit.getItemMeta();
                im.setDisplayName( "§4«" );
                exit.setItemMeta( im );
                ( (GUISubContainer) inv ).setExitIcon( exit );
            }

            if ( ( (GUISubContainer) inv ).getChild() != null ) {
                ((GUISubContainer) inv).setUseNextButton(true);
                ( (GUISubContainer) inv ).getNextButton().dispose();
                ( (GUISubContainer) inv ).getNextButton().setPosition( new Vector2i( 6, rows ) );
                ItemStack next = new ItemStack( Material.ARROW );
                ItemMeta im2 = next.getItemMeta();
                im2.setDisplayName( "§a»" );
                next.setItemMeta( im2 );
                ( (GUISubContainer) inv ).setNextIcon( next );
            }
        }

    }
    if ( invNum > 0 ) {
        GUIButton first = new GUIButton( "§a»", Material.ARROW );
        first.setPosition( new Vector2i( 6, rows ) );
        first.addEvent( new GUIEvent() {
            @Override
            public void onClick( ComponentClickEvent event ) {
                subs.get( 1 ).draw( (Player) event.getPlayer() );
            }
        } );
        container.add( first );
    }
}
 
开发者ID:LegendOnline,项目名称:InventoryAPI,代码行数:80,代码来源:ListLayout.java

示例11: clearJunk

public void clearJunk(){
	World world = Bukkit.getWorld("kaospvp");
	List<Entity> list = world.getEntities();
	for(Entity e : list){
		if(e instanceof Item){
			Item it = (Item) e;
			if( it.getItemStack().getType() == Material.POTION &&
				it.getItemStack().getDurability() == 16453){
				e.remove();
			}
			if( it.getItemStack().getType() == Material.GOLDEN_APPLE &&
				it.getItemStack().getDurability() == 0){
				e.remove();
			}
			if( it.getItemStack().getType() == Material.ARROW){
				e.remove();
			}
			if( it.getItemStack().getType() == Material.GLASS_BOTTLE){
				e.remove();
			}
			if( it.getItemStack().getType() == Material.DIAMOND_BOOTS &&
				it.getItemStack().getEnchantments().size() == 0){
				e.remove();
			}
			if( it.getItemStack().getType() == Material.DIAMOND_LEGGINGS &&
				it.getItemStack().getEnchantments().size() == 0){
				e.remove();
			}
			if( it.getItemStack().getType() == Material.DIAMOND_CHESTPLATE &&
				it.getItemStack().getEnchantments().size() == 0){
				e.remove();
			}
			if( it.getItemStack().getType() == Material.DIAMOND_HELMET &&
				it.getItemStack().getEnchantments().size() == 0){
				e.remove();
			}
			if( it.getItemStack().getType() == Material.DIAMOND_SWORD &&
				it.getItemStack().getEnchantments().size() == 0){
				e.remove();	
			}
			if( it.getItemStack().getType() == Material.BOW &&
				it.getItemStack().getEnchantments().size() == 0){
				e.remove();	
			}
			if( it.getItemStack().getType() == Material.WOOD_AXE ||
				it.getItemStack().getType() == Material.STONE_AXE ||
				it.getItemStack().getType() == Material.GOLD_AXE ||
				it.getItemStack().getType() == Material.IRON_AXE ||
				it.getItemStack().getType() == Material.DIAMOND_AXE){
				e.remove();
			}
		}
	}
}
 
开发者ID:OverloadedCore,项目名称:kaosEssentials,代码行数:54,代码来源:Core.java

示例12: acceptOrDeny

public static Inventory acceptOrDeny(ItemStack clickedRequest) {
	
	String temp = ChatColor.stripColor(clickedRequest.getItemMeta().getDisplayName());
	int clickedId = Integer.parseInt(temp.substring(9, temp.length()));
	
	BanRequest br = new BanRequest(clickedId);
	
	Inventory i = Bukkit.createInventory(null, 54, Messager.color("&eRequest #" + br.id));
	
	i.setItem(22, br.getItem());
	
	ItemStack em = new ItemStack(Material.EMERALD_BLOCK);
	ItemMeta emM = em.getItemMeta();
	emM.setDisplayName(Messager.color("&aAccept Ban Request."));
	emM.setLore(Arrays.asList(Messager.color("&7This can only be undone manually.")));
	em.setItemMeta(emM);
	
	ItemStack red = new ItemStack(Material.REDSTONE_BLOCK);
	ItemMeta redM = red.getItemMeta();
	redM.setDisplayName(Messager.color("&cDeny Ban Request."));
	redM.setLore(Arrays.asList(Messager.color("&7This can only be undone manually.")));
	red.setItemMeta(redM);
	
	i.setItem(9, em);
	i.setItem(10, em);
	i.setItem(11, em);
	
	i.setItem(15, red);
	i.setItem(16, red);
	i.setItem(17, red);
	
	i.setItem(18, em);
	i.setItem(19, em);
	i.setItem(20, em);
	
	i.setItem(24, red);
	i.setItem(25, red);
	i.setItem(26, red);
	
	i.setItem(27, em);
	i.setItem(28, em);
	i.setItem(29, em);
	
	i.setItem(33, red);
	i.setItem(34, red);
	i.setItem(35, red);
	
	ItemStack back = new ItemStack(Material.ARROW);
	ItemMeta im = back.getItemMeta();
	im.setDisplayName(Messager.color("&cBack"));
	back.setItemMeta(im);		
	i.setItem(45, back);
	
	return i;
}
 
开发者ID:JustBru00,项目名称:EpicBanRequests,代码行数:55,代码来源:GUIManager.java


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