@@ -1,31 +1,31 @@
|
||||
--- a/net/minecraft/world/item/ItemFireball.java
|
||||
+++ b/net/minecraft/world/item/ItemFireball.java
|
||||
@@ -34,12 +34,28 @@
|
||||
if (!BlockCampfire.h(iblockdata) && !CandleBlock.g(iblockdata) && !CandleCakeBlock.g(iblockdata)) {
|
||||
blockposition = blockposition.shift(itemactioncontext.getClickedFace());
|
||||
if (BlockFireAbstract.a(world, blockposition, itemactioncontext.g())) {
|
||||
@@ -32,12 +32,28 @@
|
||||
if (!BlockCampfire.canLight(iblockdata) && !CandleBlock.canLight(iblockdata) && !CandleCakeBlock.canLight(iblockdata)) {
|
||||
blockposition = blockposition.relative(itemactioncontext.getClickedFace());
|
||||
if (BlockFireAbstract.canBePlacedAt(world, blockposition, itemactioncontext.getHorizontalDirection())) {
|
||||
+ // CraftBukkit start - fire BlockIgniteEvent
|
||||
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockIgniteEvent(world, blockposition, org.bukkit.event.block.BlockIgniteEvent.IgniteCause.FIREBALL, itemactioncontext.getEntity()).isCancelled()) {
|
||||
+ if (!itemactioncontext.getEntity().getAbilities().instabuild) {
|
||||
+ itemactioncontext.getItemStack().subtract(1);
|
||||
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockIgniteEvent(world, blockposition, org.bukkit.event.block.BlockIgniteEvent.IgniteCause.FIREBALL, itemactioncontext.getPlayer()).isCancelled()) {
|
||||
+ if (!itemactioncontext.getPlayer().getAbilities().instabuild) {
|
||||
+ itemactioncontext.getItemInHand().shrink(1);
|
||||
+ }
|
||||
+ return EnumInteractionResult.PASS;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
this.a(world, blockposition);
|
||||
world.setTypeUpdate(blockposition, BlockFireAbstract.a((IBlockAccess) world, blockposition));
|
||||
world.a((Entity) itemactioncontext.getEntity(), GameEvent.BLOCK_PLACE, blockposition);
|
||||
this.playSound(world, blockposition);
|
||||
world.setBlockAndUpdate(blockposition, BlockFireAbstract.getState(world, blockposition));
|
||||
world.gameEvent(itemactioncontext.getPlayer(), GameEvent.BLOCK_PLACE, blockposition);
|
||||
flag = true;
|
||||
}
|
||||
} else {
|
||||
+ // CraftBukkit start - fire BlockIgniteEvent
|
||||
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockIgniteEvent(world, blockposition, org.bukkit.event.block.BlockIgniteEvent.IgniteCause.FIREBALL, itemactioncontext.getEntity()).isCancelled()) {
|
||||
+ if (!itemactioncontext.getEntity().getAbilities().instabuild) {
|
||||
+ itemactioncontext.getItemStack().subtract(1);
|
||||
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockIgniteEvent(world, blockposition, org.bukkit.event.block.BlockIgniteEvent.IgniteCause.FIREBALL, itemactioncontext.getPlayer()).isCancelled()) {
|
||||
+ if (!itemactioncontext.getPlayer().getAbilities().instabuild) {
|
||||
+ itemactioncontext.getItemInHand().shrink(1);
|
||||
+ }
|
||||
+ return EnumInteractionResult.PASS;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
this.a(world, blockposition);
|
||||
world.setTypeUpdate(blockposition, (IBlockData) iblockdata.set(BlockProperties.LIT, true));
|
||||
world.a((Entity) itemactioncontext.getEntity(), GameEvent.BLOCK_PLACE, blockposition);
|
||||
this.playSound(world, blockposition);
|
||||
world.setBlockAndUpdate(blockposition, (IBlockData) iblockdata.setValue(BlockProperties.LIT, true));
|
||||
world.gameEvent(itemactioncontext.getPlayer(), GameEvent.BLOCK_PLACE, blockposition);
|
||||
|
||||
Reference in New Issue
Block a user