mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-30 12:57:41 +01:00
32 lines
2.0 KiB
Diff
32 lines
2.0 KiB
Diff
--- a/net/minecraft/server/ItemFireball.java
|
|
+++ b/net/minecraft/server/ItemFireball.java
|
|
@@ -18,12 +18,28 @@
|
|
|
|
if (iblockdata.getBlock() == Blocks.CAMPFIRE) {
|
|
if (!(Boolean) iblockdata.get(BlockCampfire.b) && !(Boolean) iblockdata.get(BlockCampfire.d)) {
|
|
+ // 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));
|
|
}
|
|
} else {
|
|
blockposition = blockposition.shift(itemactioncontext.getClickedFace());
|
|
if (world.getType(blockposition).isAir()) {
|
|
+ // 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, ((BlockFire) Blocks.FIRE).a((IBlockAccess) world, blockposition));
|
|
}
|