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


Java Material.FLINT_AND_STEEL属性代码示例

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


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

示例1: toMultiBlock

public MultiBlock toMultiBlock()
{
    List mats = new ArrayList();
    ItemStack aitemstack[];
    int k = (aitemstack = recipe).length;
    for(int j = 0; j < k; j++)
    {
        ItemStack i = aitemstack[j];
        if(i == null)
            mats.add(null);
        else
        if(i.getType() == Material.CAULDRON_ITEM)
            mats.add(Material.CAULDRON);
        else
        if(i.getType() == Material.FLINT_AND_STEEL)
            mats.add(Material.FIRE);
        else
            mats.add(i.getType());
    }

    Material build[] = (Material[])mats.toArray(new Material[mats.size()]);
    return new MultiBlock(build, trigger);
}
 
开发者ID:StarWishsama,项目名称:Slimefun4-Chinese-Version,代码行数:23,代码来源:SlimefunMachine.java

示例2: onPlayerInteract

/**
 * Block Minecraft utilization
 *
 * @param event Event
 */
@SuppressWarnings("deprecation")
@EventHandler(ignoreCancelled = true)
public void onPlayerInteract(PlayerInteractEvent event)
{
    if (event.getPlayer().getItemInHand() != null && event.getPlayer().getItemInHand().getType() == (Material.MINECART))
    {
        if (event.getPlayer().getItemInHand().getType() == Material.MINECART)
        {
            event.getPlayer().sendMessage(ChatColor.RED + "L'utilisation de Minecart est bloqué.");
            event.setCancelled(true);
        }
        else if (event.getPlayer().getItemInHand().getType() == Material.FLINT_AND_STEEL && !this.game.isPvPActivated())
        {
            event.getPlayer().sendMessage(ChatColor.RED + "L'utilisation du briquet est interdit en phase de préparation.");
            event.setCancelled(true);
        }
    }
}
 
开发者ID:SamaGames,项目名称:SurvivalAPI,代码行数:23,代码来源:GameListener.java

示例3: onClick

@SuppressWarnings("deprecation")
@EventHandler
public void onClick(PlayerInteractEvent e) {
	if (e.getClickedBlock() == null)
		return;
	if (e.getClickedBlock().getType() != Material.OBSIDIAN)
		return;
	if (e.getPlayer().getItemInHand().getType() != Material.FLINT_AND_STEEL)
		return;
	
	if(!e.getPlayer().isOp()) {
		e.setCancelled(true);
	}
}
 
开发者ID:ThEWiZ76,项目名称:KingdomFactions,代码行数:14,代码来源:PortalTravelEventListener.java

示例4: onPlayerInteract

@EventHandler
  public void onPlayerInteract(PlayerInteractEvent event) {
if (Walls.getSpectators().contains(event.getPlayer().getName())) {
	event.setCancelled(true);
	return;
}

      if (event.getItem()==null) 
          return;
      
      if (!State.PVP && (event.getItem().getType()==Material.FLINT_AND_STEEL || event.getItem().getType()==Material.FIREBALL || event.getItem().getType()==Material.LAVA_BUCKET)) {
          Chat.player(event.getPlayer(), "&cYou are not allowed to use fire before the walls drop!");
          event.setCancelled(true);
      }
  }
 
开发者ID:thekeenant,项目名称:mczone,代码行数:15,代码来源:Events.java

示例5: onGameStart

/**
 * Give an unbreakable flint and steel to all the players
 *
 * @param game Game
 */
@Override
public void onGameStart(SurvivalGame game)
{
    ItemStack flintAndSteel = new ItemStack(Material.FLINT_AND_STEEL, 1);
    flintAndSteel.addUnsafeEnchantment(Enchantment.DURABILITY, 10);

    for (GamePlayer player : (Collection<GamePlayer>) game.getInGamePlayers().values())
    {
        Player p = player.getPlayerIfOnline();

        if (p != null)
            p.getInventory().addItem(flintAndSteel);
    }
}
 
开发者ID:SamaGames,项目名称:SurvivalAPI,代码行数:19,代码来源:BombersModule.java

示例6: getProgressBar

public ItemStack getProgressBar()
{
    return new ItemStack(Material.FLINT_AND_STEEL);
}
 
开发者ID:StarWishsama,项目名称:Slimefun4-Chinese-Version,代码行数:4,代码来源:Refinery.java

示例7: onCraftItem

private static void onCraftItem(Recipe recipe, CraftingInventory inventory)
{
    if (recipe.getResult().getType() == Material.FLINT_AND_STEEL)
        inventory.setResult(new ItemStack(Material.AIR));
}
 
开发者ID:SamaGames,项目名称:SurvivalAPI,代码行数:5,代码来源:DisableFlintAndSteelModule.java


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