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