Implement new cause versions of BlockIgniteEvent. Addresses BUKKIT-3609, BUKKIT-3656, BUKKIT-3657
This commit is contained in:
committed by
Travis Watkins
parent
2e6cfdb3cc
commit
a7a5f273e3
@@ -1,10 +1,6 @@
|
||||
package net.minecraft.server;
|
||||
|
||||
// CraftBukkit start
|
||||
import org.bukkit.craftbukkit.block.CraftBlockState;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.block.BlockIgniteEvent;
|
||||
// CraftBukkit end
|
||||
import org.bukkit.craftbukkit.block.CraftBlockState; // CraftBukkit
|
||||
|
||||
public class ItemFlintAndSteel extends Item {
|
||||
|
||||
@@ -49,13 +45,7 @@ public class ItemFlintAndSteel extends Item {
|
||||
|
||||
if (i1 == 0) {
|
||||
// CraftBukkit start - store the clicked block
|
||||
org.bukkit.block.Block blockClicked = world.getWorld().getBlockAt(i, j, k);
|
||||
Player thePlayer = (Player) entityhuman.getBukkitEntity();
|
||||
|
||||
BlockIgniteEvent eventIgnite = new BlockIgniteEvent(blockClicked, BlockIgniteEvent.IgniteCause.FLINT_AND_STEEL, thePlayer);
|
||||
world.getServer().getPluginManager().callEvent(eventIgnite);
|
||||
|
||||
if (eventIgnite.isCancelled()) {
|
||||
if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockIgniteEvent(world, i, j, k, org.bukkit.event.block.BlockIgniteEvent.IgniteCause.FLINT_AND_STEEL, entityhuman).isCancelled()) {
|
||||
itemstack.damage(1, entityhuman);
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user