本文整理汇总了Java中org.bukkit.Material.TRIPWIRE_HOOK属性的典型用法代码示例。如果您正苦于以下问题:Java Material.TRIPWIRE_HOOK属性的具体用法?Java Material.TRIPWIRE_HOOK怎么用?Java Material.TRIPWIRE_HOOK使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.bukkit.Material
的用法示例。
在下文中一共展示了Material.TRIPWIRE_HOOK属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getCrateKey
public static ItemStack getCrateKey(){
ItemStack key = new ItemStack(Material.TRIPWIRE_HOOK);
ItemMeta keyMeta = key.getItemMeta();
keyMeta.setDisplayName(ChatColor.GOLD + "Crate Key");
List<String> lore = keyMeta.getLore();
lore.clear();
lore.add("Bring this to the crate at spawn to open!");
keyMeta.setLore(lore);
key.setItemMeta(keyMeta);
return key;
}
示例2: getVoteCrateKey
public static ItemStack getVoteCrateKey(){
ItemStack key = new ItemStack(Material.TRIPWIRE_HOOK);
ItemMeta keyMeta = key.getItemMeta();
keyMeta.setDisplayName(ChatColor.GOLD + "Vote Crate Key");
List<String> lore = keyMeta.getLore();
lore.clear();
lore.add("Bring this to the vote crate at spawn to open!");
keyMeta.setLore(lore);
key.setItemMeta(keyMeta);
return key;
}
示例3: getReleaseCrateKey
public static ItemStack getReleaseCrateKey(){
ItemStack key = new ItemStack(Material.TRIPWIRE_HOOK);
ItemMeta keyMeta = key.getItemMeta();
keyMeta.setDisplayName(ChatColor.GOLD + "Release Crate Key");
List<String> lore = keyMeta.getLore();
lore.clear();
lore.add("Bring this to the release crate at spawn to open!");
keyMeta.setLore(lore);
key.setItemMeta(keyMeta);
return key;
}
示例4: getItemStack
@Override
public ItemStack getItemStack() {
ItemStack stack = new ItemStack(Material.TRIPWIRE_HOOK, 1);
ItemMeta meta = stack.getItemMeta();
meta.setDisplayName(getColour() + getName() + " Key");
meta.setLore(Lists.newArrayList(ChatColor.GRAY + "Right click an empty Chest to use."));
stack.setItemMeta(meta);
return stack;
}
示例5: 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);
}
}
}
}