Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Call ignite event for fireball shot from dispenser.

  • Loading branch information...
commit 5a11b0ddc89142e91341ff2a42dde642196f3a74 1 parent b02fc4c
Travis Watkins authored May 14, 2012
15  src/main/java/net/minecraft/server/EntitySmallFireball.java
... ...
@@ -1,6 +1,9 @@
1 1
 package net.minecraft.server;
2 2
 
3  
-import org.bukkit.event.entity.EntityCombustByEntityEvent; // CraftBukkit
  3
+// CraftBukkit start
  4
+import org.bukkit.event.block.BlockIgniteEvent;
  5
+import org.bukkit.event.entity.EntityCombustByEntityEvent;
  6
+// CraftBukkit end
4 7
 
5 8
 public class EntitySmallFireball extends EntityFireball {
6 9
 
@@ -63,7 +66,15 @@ protected void a(MovingObjectPosition movingobjectposition) {
63 66
                 }
64 67
 
65 68
                 if (this.world.isEmpty(i, j, k)) {
66  
-                    this.world.setTypeId(i, j, k, Block.FIRE.id);
  69
+                    // CraftBukkit start
  70
+                    org.bukkit.block.Block block = world.getWorld().getBlockAt(i, j, k);
  71
+                    BlockIgniteEvent event = new BlockIgniteEvent(block, BlockIgniteEvent.IgniteCause.FIREBALL, null);
  72
+                    world.getServer().getPluginManager().callEvent(event);
  73
+
  74
+                    if (!event.isCancelled()) {
  75
+                        this.world.setTypeId(i, j, k, Block.FIRE.id);
  76
+                    }
  77
+                    // CraftBukkit end
67 78
                 }
68 79
             }
69 80
 

0 notes on commit 5a11b0d

Please sign in to comment.
Something went wrong with that request. Please try again.