mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-26 20:46:59 +01:00
32 lines
1.8 KiB
Diff
32 lines
1.8 KiB
Diff
--- a/net/minecraft/server/ItemFireball.java
|
|
+++ b/net/minecraft/server/ItemFireball.java
|
|
@@ -14,12 +14,28 @@
|
|
boolean flag = false;
|
|
|
|
if (BlockCampfire.h(iblockdata)) {
|
|
+ // 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().abilities.canInstantlyBuild) {
|
|
+ itemactioncontext.getItemStack().subtract(1);
|
|
+ }
|
|
+ return EnumInteractionResult.PASS;
|
|
+ }
|
|
+ // CraftBukkit end
|
|
this.a(world, blockposition);
|
|
world.setTypeUpdate(blockposition, (IBlockData) iblockdata.set(BlockCampfire.b, true));
|
|
flag = true;
|
|
} else {
|
|
blockposition = blockposition.shift(itemactioncontext.getClickedFace());
|
|
if (BlockFireAbstract.a(world, blockposition, itemactioncontext.f())) {
|
|
+ // 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().abilities.canInstantlyBuild) {
|
|
+ itemactioncontext.getItemStack().subtract(1);
|
|
+ }
|
|
+ return EnumInteractionResult.PASS;
|
|
+ }
|
|
+ // CraftBukkit end
|
|
this.a(world, blockposition);
|
|
world.setTypeUpdate(blockposition, BlockFireAbstract.a((IBlockAccess) world, blockposition));
|
|
flag = true;
|