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


Java Material.PAPER屬性代碼示例

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


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

示例1: onPlayerInteract

@EventHandler
public void onPlayerInteract(PlayerInteractEvent e) {   
    if (e.getAction() == Action.RIGHT_CLICK_BLOCK) { // This check needs to be there, 'cause RightClickAction has only the getType function, LeftClickAction doesnt and boooom!!
        Player player = (Player) e.getPlayer();
        ItemStack item = e.getItem();
        Block block = e.getClickedBlock();
        String bankId = BukkitUtils.getNBTTag(item, "bankid");
        
        if (item == null || block == null) return;
        
        if (bankId != null && bankId.length() > 0 && item.getType() == Material.PAPER && block.getType() == Material.ENDER_STONE) {
            // got a foreign card?
            if (!bankId.equals(player.getUniqueId().toString())) {
                player.getInventory().remove(item);
                BankomatCommand.appendCreditCardToUser(player); 
            } 
            
            player.openInventory(bankUi); // Dispatch our event by opening bankUi here:
        }   
    }
}
 
開發者ID:srbinas,項目名稱:bankomat,代碼行數:21,代碼來源:BankMenuListener.java

示例2: getItem

public ItemStack getItem() {
	ItemStack is = new ItemStack(Material.PAPER);
	ItemMeta im = is.getItemMeta();
	
	/**
	 * Item:
	 * 
	 * Name = Request #x
	 * Lore 1: Requested by: _name_
	 * Lore :  Ban: 
	 * Lore 2: Reason: reason
	 * Lore 3: Time: time 
	 */
	
	im.setDisplayName(Messager.color("&eRequest #" + id));
	im.setLore(Arrays.asList(Messager.color("&eRequested by: &7" + Bukkit.getOfflinePlayer(UUID.fromString(openerUUID)).getName()), 
			Messager.color("&eBan: &7" + Bukkit.getOfflinePlayer(UUID.fromString(playerToBanUUID)).getName()),
			Messager.color("&eReason: &7" + banReason), 
			Messager.color("&eRequested at: &7" + timeOpenedFormatted)));
	
	is.setItemMeta(im);
	
	return is;
}
 
開發者ID:JustBru00,項目名稱:EpicBanRequests,代碼行數:24,代碼來源:BanRequest.java

示例3: appendCreditCardToUser

public static void appendCreditCardToUser(Player player) {
    String bankId = Mysql.selectQuery("SELECT banknr FROM player WHERE uuid = '" + player.getUniqueId() + "'", "banknr");
    ItemStack item = new ItemStack(Material.PAPER, 1);       
    item = BukkitUtils.addCustomNBTTag(item, 
                                 new ItemInformation(
                                                     String.format(CREDIT_CARD_ITEM_TOPIC, "EURO"), 
                                                     null,
                                                     String.format(CREDIT_CARD_TEXT_FIRST_LINE, player.getName()), 
                                                     String.format(CREDIT_CARD_TEXT_SECOND_LINE, "DEU" + bankId)
                                 ),
                                 "bankid", player.getUniqueId().toString());
    player.getInventory().addItem(item);
}
 
開發者ID:srbinas,項目名稱:bankomat,代碼行數:13,代碼來源:BankomatCommand.java

示例4: getVotingData

/**
 * Returns the VotingData used in game voting.
 * @param registeredGame
 * @return
 */
public VotingData getVotingData(Class<? extends BaseGame> registeredGame) {
    Preconditions.checkNotNull(registeredGame, "Game cannot be null");
    if(!registeredGames.contains(registeredGame)) return new VotingData(new MaterialData(Material.PAPER), "Undefined");
    if(votingMaterialData.containsKey(registeredGame)) return votingMaterialData.get(registeredGame);
    return new VotingData(new MaterialData(Material.PAPER), "Undefined");
}
 
開發者ID:ArcadiaPlugins,項目名稱:Arcadia-Spigot,代碼行數:11,代碼來源:GameRegistry.java

示例5: getMedicine02

/**
 * 
 * @return ����
 */
public static ItemStack getMedicine02(){
	ItemStack sw=new ItemStack(Material.PAPER);
	ItemMeta im = sw.getItemMeta();
	im.setDisplayName("��a��l����");
	List<String> l=new LinkedList<String>();
	l.add("��2���������Լ��Ĺ���");
	l.add("��eҲ������Ҫע�ⰴʱ��һ��.");
	im.setLore(l);
	sw.setItemMeta(im);
	return sw;
}
 
開發者ID:SchoolUniform,項目名稱:RealSurvival,代碼行數:15,代碼來源:Items.java

示例6: getRemoveItem

private ItemStack getRemoveItem(Player p){
    ConfigManager.load();
    FileConfiguration config = ConfigManager.get();

    Material mat = config.getString("gui.gui-item.item") != null ?
        Material.valueOf(config.getString("gui.gui-item.item")) : Material.PAPER;

    ItemStack is = new ItemStack(mat);
    is.setDurability(Short.valueOf(ConfigManager.getInt("gui.gui-item.data")+""));
    ItemMeta im = is.getItemMeta();

    ArrayList<String> lore = new ArrayList<>();

    String title = ColorUtil.translate(ConfigManager.getString("gui.gui-item.name"));
    String id = StorageHandler.getPlayerTag(p) != null ? StorageHandler.getPlayerTag(p) : "No";
    title = title.replace("%id%", WordUtils.capitalizeFully(id.toLowerCase()));

    im.setDisplayName(title);

    for(String l : config.getStringList("gui.gui-item.lore")){
        lore.add(ColorUtil.translate(l));
    }
    im.setLore(lore);

    is.setItemMeta(im);

    return is;
}
 
開發者ID:Chazmondo,項目名稱:DogTags,代碼行數:28,代碼來源:TagsCommand.java

示例7: addItem

/**
 * Adds an EmojiList item to the gui specified.
 *
 * @param gui The gui {@link org.bukkit.inventory.Inventory}.
 * @param keyList The list of {@link EmojiHandler#emojis} keys.
 * @param emojiMapPosition The current position in the {@link EmojiHandler#emojis}.
 */
private void addItem(Inventory gui, List<String> keyList, int emojiMapPosition) {
	ItemStack stack = new ItemStack(Material.PAPER, 1);
	ItemMeta meta = stack.getItemMeta();
	String key = keyList.get(emojiMapPosition);
	meta.setDisplayName(ChatColor.AQUA + key + ChatColor.RESET + " " + plugin.getEmojiHandler().getEmojis().get(key));
	stack.setItemMeta(meta);
	gui.addItem(stack);
}
 
開發者ID:RadBuilder,項目名稱:EmojiChat,代碼行數:15,代碼來源:EmojiChatGui.java

示例8: getArchivedItem

public ItemStack getArchivedItem() {
	ItemStack is = new ItemStack(Material.PAPER);
	ItemMeta im = is.getItemMeta();
	
	/**
	 * Item:
	 * 
	 * Name = Request #x
	 * Lore 1: Requested by: _name_
	 * Lore 2: Reason: reason
	 * Lore 3: Requested at: time 
	 * Lore 4: Closed by: name
	 * Lore 5: Closed at: time
	 * Lore 6: Request was: accept/deny
	 */
	
	im.setDisplayName(Messager.color("&eRequest #" + id));
	String temp = null;
	if (accepted) {
		temp = "&aAccepted";
	} else  if (denied) {
		temp = "&cDenied";
	}
	im.setLore(Arrays.asList(Messager.color("&eRequested by: &7" + Bukkit.getOfflinePlayer(UUID.fromString(openerUUID)).getName()), Messager.color("&eReason: &7" + banReason), 
			Messager.color("&eRequested at: &7" + timeOpenedFormatted), Messager.color("&eClosed by: &7" + Bukkit.getOfflinePlayer(UUID.fromString(closerUUID)).getName()), 
			Messager.color("&eClosed at: &7" + timeClosedFormatted), Messager.color("&eRequest was: " + temp)));
	
	is.setItemMeta(im);
	
	return is;
}
 
開發者ID:JustBru00,項目名稱:EpicBanRequests,代碼行數:31,代碼來源:BanRequest.java

示例9: generate

protected MenuItem generate(int row, int col) {
    MenuItem mi = new MenuItem(row, col, new ItemStack(Material.PAPER), name, fullLore, null);
    return mi;
}
 
開發者ID:edasaki,項目名稱:ZentrelaRPG,代碼行數:4,代碼來源:ListedCommand.java

示例10: onInteract

public void onInteract(PlayerInteractEvent e, Entity ent) {
	//e.getPlayer().sendMessage("A");
	if (e.getAction() == Action.RIGHT_CLICK_BLOCK) {
		for (Entity en : e.getPlayer().getWorld().getEntities()) {
			if (en.getCustomName() != null && en.getCustomName().equals(getName()) && en.getLocation().add(-0.5, 0, -0.5).equals(e.getClickedBlock().getLocation())) {
				
				Menu m;
				
				if (e.getPlayer().getInventory().getItemInHand().getType() == Material.TRIPWIRE_HOOK) {
					m = new Menu("Keycode2", 27);
				}
				else {
					m = new Menu("Keycode", 27);
				}
				
				ItemStack code = new ItemStack(Material.PAPER, 1);
				
				ItemMeta codem = code.getItemMeta();
				codem.setDisplayName("&f&l".replace('&', '�'));
				
				code.setItemMeta(codem);
				
				m.inv.setItem(15, code);
				
				ItemStack res = new ItemStack(Material.BUCKET, 1);
				
				ItemMeta resm = res.getItemMeta();
				resm.setDisplayName("&f&lReset".replace('&', '�'));
				
				res.setItemMeta(resm);
				
				m.inv.setItem(13, res);
				
				for (int i = 0; i < 27; i++) {
					ItemStack it = new ItemStack(Material.IRON_BLOCK, 1);
					
					
					HashMap<Integer, Integer> id = new HashMap<Integer, Integer>();
					id.put(0, 1);
					id.put(1, 2);
					id.put(2, 3);
					id.put(9, 4);
					id.put(10, 5);
					id.put(11, 6);
					id.put(18, 7);
					id.put(19, 8);
					id.put(20, 9);
					id.put(12, 0);
					if (id.containsKey(i)) {
						ItemMeta itm = it.getItemMeta();
						itm.setDisplayName(("&f&l" + String.valueOf(id.get(i))).replace('&', '�'));
						
						it.setItemMeta(itm);
						m.inv.setItem(i, it);
					}
				}
				
				
				if (plu.containsKey(e.getPlayer())) {plu.remove(e.getPlayer());}
				if (plr.containsKey(e.getPlayer())) {plr.remove(e.getPlayer());}
				if (plrs.contains(e.getPlayer())) {plrs.remove(e.getPlayer());}
				
				if (e.getPlayer().getInventory().getItemInHand().getType() == Material.TRIPWIRE_HOOK) {
					m.show(e.getPlayer());
					e.getPlayer().sendMessage(ChatColor.GREEN + "Please enter the keycode to then reset");
					plr.put(e.getPlayer(), en);
				}
				else {
					m.show(e.getPlayer());
					e.getPlayer().sendMessage(ChatColor.GREEN + "Please enter the keycode");
					plu.put(e.getPlayer(), en);
				}
				
				e.setCancelled(true);
			}
		}
	}
}
 
開發者ID:GigaGamma,項目名稱:SuperiorCraft,代碼行數:78,代碼來源:Keycode.java

示例11: nullElement

private Element nullElement() {
    return new BasicElement(new ItemStack(Material.PAPER), (ne) -> {}, "nullElement");
}
 
開發者ID:Personinblack,項目名稱:black,代碼行數:3,代碼來源:LiveElement.java


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