本文整理汇总了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:
}
}
}
示例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;
}
示例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);
}
示例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");
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例9: generate
protected MenuItem generate(int row, int col) {
MenuItem mi = new MenuItem(row, col, new ItemStack(Material.PAPER), name, fullLore, null);
return mi;
}
示例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);
}
}
}
}
示例11: nullElement
private Element nullElement() {
return new BasicElement(new ItemStack(Material.PAPER), (ne) -> {}, "nullElement");
}