mirror of
				https://hub.spigotmc.org/stash/scm/spigot/craftbukkit.git
				synced 2025-10-31 01:45:57 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			32 lines
		
	
	
		
			2.1 KiB
		
	
	
	
		
			Diff
		
	
	
	
	
	
			
		
		
	
	
			32 lines
		
	
	
		
			2.1 KiB
		
	
	
	
		
			Diff
		
	
	
	
	
	
| --- a/net/minecraft/world/item/ItemFireball.java
 | |
| +++ b/net/minecraft/world/item/ItemFireball.java
 | |
| @@ -39,12 +39,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.getPlayer()).isCancelled()) {
 | |
| +                    if (!itemactioncontext.getPlayer().getAbilities().instabuild) {
 | |
| +                        itemactioncontext.getItemInHand().shrink(1);
 | |
| +                    }
 | |
| +                    return EnumInteractionResult.PASS;
 | |
| +                }
 | |
| +                // CraftBukkit end
 | |
|                  this.playSound(world, blockposition);
 | |
|                  world.setBlockAndUpdate(blockposition, BlockFireAbstract.getState(world, blockposition));
 | |
|                  world.gameEvent(itemactioncontext.getPlayer(), (Holder) 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.getPlayer()).isCancelled()) {
 | |
| +                if (!itemactioncontext.getPlayer().getAbilities().instabuild) {
 | |
| +                    itemactioncontext.getItemInHand().shrink(1);
 | |
| +                }
 | |
| +                return EnumInteractionResult.PASS;
 | |
| +            }
 | |
| +            // CraftBukkit end
 | |
|              this.playSound(world, blockposition);
 | |
|              world.setBlockAndUpdate(blockposition, (IBlockData) iblockdata.setValue(BlockProperties.LIT, true));
 | |
|              world.gameEvent(itemactioncontext.getPlayer(), (Holder) GameEvent.BLOCK_CHANGE, blockposition);
 |