当前位置: 首页>>代码示例>>Java>>正文


Java Material.FEATHER属性代码示例

本文整理汇总了Java中org.bukkit.Material.FEATHER属性的典型用法代码示例。如果您正苦于以下问题:Java Material.FEATHER属性的具体用法?Java Material.FEATHER怎么用?Java Material.FEATHER使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.bukkit.Material的用法示例。


在下文中一共展示了Material.FEATHER属性的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onPlayerGlide

@EventHandler
public void onPlayerGlide(EntityToggleGlideEvent event)
{
    if (!(event.getEntity() instanceof Player))
        return;

    if (!SamaGamesAPI.get().getPermissionsManager().hasPermission(event.getEntity(), "network.vipplus"))
        if (((Player) event.getEntity()).isFlying() && ((Player) event.getEntity()).getInventory().getChestplate().getType() == Material.ELYTRA)
            ((Player) event.getEntity()).getInventory().setChestplate(null);

    if (event.isGliding() && RestrictedVersion.isLoggedInPost19((Player) event.getEntity()))
    {
        ItemStack stack = new ItemStack(Material.FEATHER);
        ItemMeta meta = stack.getItemMeta();
        meta.setDisplayName(ChatColor.GOLD + "" + ChatColor.BOLD + "Ventilateur" + ChatColor.RESET + "" + ChatColor.GRAY + " (Clic-droit)");
        stack.setItemMeta(meta);
        stack.addUnsafeEnchantment(Enchantment.DURABILITY, 1);
        ((Player) event.getEntity()).getInventory().setItem(3, stack);
    }
    else
    {
        ((Player) event.getEntity()).getInventory().setItem(3, new ItemStack(Material.AIR));
    }
}
 
开发者ID:SamaGames,项目名称:Hub,代码行数:24,代码来源:PlayerListener.java

示例2: onArcherJumpClick

@EventHandler(ignoreCancelled=false, priority=EventPriority.HIGH)
public void onArcherJumpClick(PlayerInteractEvent event)
{
    Action action = event.getAction();
    if (((action == Action.RIGHT_CLICK_AIR) || (action == Action.RIGHT_CLICK_BLOCK)) &&
            (event.hasItem()) && (event.getItem().getType() == Material.FEATHER))
    {
        if (this.plugin.getPvpClassManager().getEquippedClass(event.getPlayer()) != this) {
            return;
        }
        Player player = event.getPlayer();
        UUID uuid = player.getUniqueId();
        long timestamp = this.archerJumpCooldowns.get(uuid);
        long millis = System.currentTimeMillis();
        long remaining = timestamp == this.archerJumpCooldowns.getNoEntryValue() ? -1L : timestamp - millis;
        if (remaining > 0L)
        {
            player.sendMessage(ChatColor.RED + "Cannot use Jump Boost for another " + DurationFormatUtils.formatDurationWords(remaining, true, true) + ".");
        }
        else
        {
            ItemStack stack = player.getItemInHand();
            if (stack.getAmount() == 1) {
                player.setItemInHand(new ItemStack(Material.AIR, 1));
            } else {
                stack.setAmount(stack.getAmount() - 1);
            }
            player.sendMessage(ChatColor.GREEN + "Jump Boost 4 activated for 7 seconds.");

            this.plugin.getEffectRestorer().setRestoreEffect(player, ARCHER_JUMP_EFFECT);
            this.archerJumpCooldowns.put(event.getPlayer().getUniqueId(), System.currentTimeMillis() + ARCHER_JUMP_COOLDOWN_DELAY);
        }
    }
}
 
开发者ID:funkemunky,项目名称:HCFCore,代码行数:34,代码来源:ArcherClass.java

示例3: onRightClick2

@EventHandler
public void onRightClick2(PlayerInteractEvent event)
{
    if(event.getAction().equals(Action.RIGHT_CLICK_AIR) || event.getAction().equals(Action.RIGHT_CLICK_BLOCK)) {
          Player player = event.getPlayer();
          if ((modMode.contains(player.getName())) && (player.getItemInHand().getType() == Material.FEATHER)) {
              player.chat("/v");
          }
    }
}
 
开发者ID:funkemunky,项目名称:HCFCore,代码行数:10,代码来源:ModeratorMode.java

示例4: Trazadoras

public Trazadoras(){
    super(6, Material.FEATHER, "BALAS TRAZADORAS", "Munición explosivo-perforante de gran calibre.");
}
 
开发者ID:cadox8,项目名称:WC,代码行数:3,代码来源:Trazadoras.java

示例5: doInteraction

public void doInteraction(Player player, ItemStack stack)
{
    if (stack.getType() == Material.COMPASS)
    {
        this.hub.getGuiManager().openGui(player, new GuiMain(this.hub));
    }
    else if (stack.getType() == Material.SKULL_ITEM)
    {
        this.hub.getGuiManager().openGui(player, new GuiProfile(this.hub));
    }
    else if (stack.getType() == Material.ENDER_CHEST)
    {
        this.hub.getGuiManager().openGui(player, new GuiCosmetics(this.hub));
    }
    else if (stack.getType() == Material.GOLD_INGOT)
    {
        this.hub.getGuiManager().openGui(player, new GuiShop(this.hub));
    }
    else if (stack.getType() == Material.BARRIER && this.hub.getParkourManager().getPlayerParkour(player.getUniqueId()) != null)
    {
        this.hub.getParkourManager().getPlayerParkour(player.getUniqueId()).quitPlayer(player);
    }
    else if (stack.getType() == Material.ENDER_PEARL && this.hub.getParkourManager().getPlayerParkour(player.getUniqueId()) != null)
    {
        this.hub.getParkourManager().getPlayerParkour(player.getUniqueId()).failPlayer(player);
    }
    else if (player.getInventory().getHeldItemSlot() == 6)
    {
        this.hub.getServer().getScheduler().runTask(this.hub, () -> this.hub.getCosmeticManager().getGadgetManager().useSelectedCosmetic(player, stack));
    }
    else if (stack.getType() == Material.ELYTRA)
    {
        if (stack.getEnchantments().isEmpty())
        {
            ItemStack elytra = new ItemStack(Material.ELYTRA);
            ItemMeta meta = elytra.getItemMeta();
            meta.spigot().setUnbreakable(true);
            elytra.setItemMeta(meta);

            player.getInventory().setChestplate(elytra);
            this.setInventoryToPlayer(player);
        }
        else
        {
            player.getInventory().setChestplate(null);
            this.setInventoryToPlayer(player);
        }

        player.playSound(player.getLocation(), Sound.ENTITY_HORSE_SADDLE, 1F, 1F);
    }
    else if (stack.getType() == Material.FEATHER && player.isGliding() && player.getVelocity().lengthSquared() != 0)
    {
        if (!SamaGamesAPI.get().getPermissionsManager().hasPermission(player, "network.vip"))
        {
            player.sendMessage(ChatColor.RED + "Devenez VIP pour utiliser le booster.");
            return;
        }

        Vector velocity = player.getVelocity().add(player.getLocation().getDirection().normalize().multiply(1.5D));
        ((CraftPlayer)player).getHandle().motX = velocity.getX();
        ((CraftPlayer)player).getHandle().motY = velocity.getY();
        ((CraftPlayer)player).getHandle().motZ = velocity.getZ();
        ((CraftPlayer)player).getHandle().velocityChanged = true;
        player.getWorld().playSound(player.getLocation(), Sound.ENTITY_ENDERDRAGON_FLAP, 2F, 2F);

        this.hub.getServer().getScheduler().runTask(this.hub, () -> SamaGamesAPI.get().getAchievementManager().getAchievementByID(5).unlock(player.getUniqueId()));
    }
}
 
开发者ID:SamaGames,项目名称:Hub,代码行数:68,代码来源:StaticInventory.java

示例6: 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

示例7: registerAbilities

/**
 * Registers all the abilities
 */
private void registerAbilities() {
	abilities = new ArrayList<>();
	Ability ability;
	
	// Haste
	ability = new Ability("Haste", Material.GOLD_BOOTS, 10, 100);
	ability.setItems(Arrays.asList(ItemType.SWORD, ItemType.AXE, ItemType.PICKAXE));
	ability.addDescription(ChatColor.GRAY + "Gives Haste Effect");
	ability.addDescription(ChatColor.GRAY + "Haste Level: " + ChatColor.RED + "I");
	abilities.add(ability);
	
	// Poison
	ability = new Ability("Poison", Material.BEETROOT, 15, 150);
	ability.setItems(Arrays.asList(ItemType.SWORD, ItemType.AXE));
	ability.addDescription(ChatColor.GRAY + "Poisons target enemy");
	ability.addDescription(ChatColor.GRAY + "Poison Level: " + ChatColor.RED + "I");
	ability.addDescription(ChatColor.GRAY + "Poison Duration: " + ChatColor.RED + "3 seconds");
	abilities.add(ability);
	
	// AoE (4 blocks)
	ability = new Ability("AoE", Material.GOLD_PICKAXE, 20, 750);
	ability.setItems(Arrays.asList(ItemType.PICKAXE));
	ability.addDescription(ChatColor.GRAY + "Destroys 4 blocks instead of 1");
	abilities.add(ability);
	
	// Magnet
	ability = new Ability("Magnet", Material.DETECTOR_RAIL, 25, 250);
	ability.setItems(Arrays.asList(ItemType.PICKAXE));
	ability.addDescription(ChatColor.GRAY + "Small chance to get crate key");
	ability.addDescription(ChatColor.GRAY + "Chance: " + ChatColor.RED + "0.01%");
	abilities.add(ability);
	
	// Flame
	ability = new Ability("Flame", Material.BLAZE_POWDER, 15, 750);
	ability.setItems(Arrays.asList(ItemType.SWORD, ItemType.AXE));
	ability.addDescription(ChatColor.GRAY + "Sets target on fire");
	ability.addDescription(ChatColor.GRAY + "Fire Duration: " + ChatColor.RED + "3 seconds");
	abilities.add(ability);
	
	// High Jump
	ability = new Ability("High Jump", Material.ELYTRA, 20, 200);
	ability.setItems(Arrays.asList(ItemType.BOOTS, ItemType.LEGGINGS, ItemType.CHESTPLATE, ItemType.HELMET));
	ability.addDescription(ChatColor.GRAY + "Jump 2 blocks high");
	ability.addDescription(ChatColor.GRAY + "Jump Level: " + ChatColor.RED + "II");
	abilities.add(ability);
	
	// Speed
	ability = new Ability("Speed", Material.FEATHER, 15, 150);
	ability.setItems(Arrays.asList(ItemType.BOOTS, ItemType.LEGGINGS, ItemType.CHESTPLATE, ItemType.HELMET));
	ability.addDescription(ChatColor.GRAY + "Gives speed boost");
	ability.addDescription(ChatColor.GRAY + "Speed Level: " + ChatColor.RED + "I");
	abilities.add(ability);
	
	// Lucky Repair
	ability = new Ability("Lucky Repair", Material.ANVIL, 25, 250);
	ability.setItems(Arrays.asList(ItemType.SWORD, ItemType.AXE, ItemType.PICKAXE));
	ability.addDescription(ChatColor.GRAY + "Small chance to repair item");
	ability.addDescription(ChatColor.GRAY + "Chance: " + ChatColor.RED + "0.01%");
	abilities.add(ability);
}
 
开发者ID:benNek,项目名称:AsgardAscension,代码行数:63,代码来源:AbilityManager.java


注:本文中的org.bukkit.Material.FEATHER属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。