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