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


Java Material.PACKED_ICE屬性代碼示例

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


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

示例1: rightClick

@EventHandler
public void rightClick(PlayerInteractEntityEvent e)
{
  if (!(e.getRightClicked() instanceof Player)) {
    return;
  }
  Player player = e.getPlayer();
  Player p = (Player)e.getRightClicked();
  if ((modMode.contains(player.getName())) && ((p instanceof Player)) && ((player instanceof Player)) && (player.getItemInHand().getType() == Material.BOOK)) {
    player.openInventory(p.getInventory());
    player.sendMessage(ChatColor.GRAY + " §6§ §rNow opening the inventory of §e" + p.getName() + ChatColor.GRAY + "§r.");
  }
 
  else if ((modMode.contains(player.getName())) && ((p instanceof Player)) && ((player instanceof Player)) && (player.getItemInHand().getType() == Material.PACKED_ICE)) {
  	player.sendMessage(ChatColor.GRAY + " §6§ §rAttempting to freeze §e"+ p.getName() + "§r.");
      player.chat("/ss " + p.getName());
  }
}
 
開發者ID:funkemunky,項目名稱:HCFCore,代碼行數:18,代碼來源:ModeratorMode.java

示例2: isOnIce

/**
 * @return if we are on ice.
 */
public static boolean isOnIce(Location location) {
    Block down = location.getBlock().getRelative(BlockFace.DOWN);
    boolean relativeDown = down.getType() == Material.ICE || down.getType() == Material.PACKED_ICE;

    Block low = location.getBlock().getRelative(0, -2, 0);
    boolean relativeLow = low.getType() == Material.ICE || low.getType() == Material.PACKED_ICE;
    return relativeDown || relativeLow;
}
 
開發者ID:Vrekt,項目名稱:Arc-v2,代碼行數:11,代碼來源:LocationHelper.java

示例3: modItems

public static void modItems(Player p)
{
  Inventory inv = p.getInventory();
  inv.clear();
  ItemStack modCompass = new ItemStack(Material.COMPASS);
  ItemStack modBook = new ItemStack(Material.BOOK);
  ItemStack modFreeze = new ItemStack(Material.PACKED_ICE);
  ItemStack modTp = new ItemStack(Material.EYE_OF_ENDER);
  ItemStack modVanish = new ItemStack(Material.FEATHER);
 
  ItemMeta compassMeta = modCompass.getItemMeta();
  ItemMeta bookMeta = modBook.getItemMeta();
  ItemMeta freezeMeta = modFreeze.getItemMeta();
  ItemMeta tpMeta = modTp.getItemMeta();
  ItemMeta vanishMeta = modVanish.getItemMeta();
 
  compassMeta.setDisplayName("§cWhoosh");
  bookMeta.setDisplayName("§cInspect Player");
  freezeMeta.setDisplayName("§cFreeze Player");
  vanishMeta.setDisplayName("§cToggle Vanish");
  tpMeta.setDisplayName("§cRandom Teleporter");
 
  ArrayList<String> modCompassLore = new ArrayList();
  ArrayList<String> modBookLore = new ArrayList();
  ArrayList<String> modFreezeLore = new ArrayList();
  ArrayList<String> modVanishLore = new ArrayList();
  ArrayList<String> modTpLore = new ArrayList();
 
  modCompassLore.add("§7Used to teleport to eye location.");
  modBookLore.add("§7Used to inspect a players inventory.");
  modFreezeLore.add("§7Used to freeze a player.");
  modVanishLore.add("§7Used to toggle vanish.");
  modTpLore.add("§7Used to teleport to a random player.");
 
  compassMeta.setLore(modCompassLore);
  bookMeta.setLore(modBookLore);
  freezeMeta.setLore(modFreezeLore);
  vanishMeta.setLore(modVanishLore);
  tpMeta.setLore(modTpLore);
 
  modCompass.setItemMeta(compassMeta);
  modBook.setItemMeta(bookMeta);
  modFreeze.setItemMeta(freezeMeta);
  modTp.setItemMeta(tpMeta);
  modVanish.setItemMeta(vanishMeta);
 
  inv.setItem(0, modCompass);
  inv.setItem(3, modVanish);
  inv.setItem(4, modBook);
  inv.setItem(5, modFreeze);
  inv.setItem(8, modTp);
}
 
開發者ID:funkemunky,項目名稱:HCFCore,代碼行數:52,代碼來源:ModeratorMode.java


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