本文整理汇总了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);
}
示例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);
}
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例6: getProgressBar
public ItemStack getProgressBar()
{
return new ItemStack(Material.FLINT_AND_STEEL);
}
示例7: onCraftItem
private static void onCraftItem(Recipe recipe, CraftingInventory inventory)
{
if (recipe.getResult().getType() == Material.FLINT_AND_STEEL)
inventory.setResult(new ItemStack(Material.AIR));
}