mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-25 02:17:35 +01:00
18 lines
1.2 KiB
Diff
18 lines
1.2 KiB
Diff
--- a/net/minecraft/server/ItemFireball.java
|
|
+++ b/net/minecraft/server/ItemFireball.java
|
|
@@ -15,6 +15,14 @@
|
|
BlockPosition blockposition = itemactioncontext.getClickPosition().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
|
|
world.a((EntityHuman) null, blockposition, SoundEffects.ITEM_FIRECHARGE_USE, SoundCategory.BLOCKS, 1.0F, (ItemFireball.k.nextFloat() - ItemFireball.k.nextFloat()) * 0.2F + 1.0F);
|
|
world.setTypeUpdate(blockposition, ((BlockFire) Blocks.FIRE).a((IBlockAccess) world, blockposition));
|
|
}
|