diff options
author | Robert Sargant <robert@sargant.com> | 2011-03-16 11:49:37 +0000 |
---|---|---|
committer | Erik Broes <erikbroes@grum.nl> | 2011-04-02 17:12:18 +0200 |
commit | 39972530f241498707afde36919a65852d72bcb2 (patch) | |
tree | f6fbc39076042282ee2df54de03c95ba0ff153c6 /src/main/java/net/minecraft/server/EntityBoat.java | |
parent | 325f4e0c22228a61dfbf834261321f18c3b69859 (diff) | |
download | craftbukkit-39972530f241498707afde36919a65852d72bcb2.tar craftbukkit-39972530f241498707afde36919a65852d72bcb2.tar.gz craftbukkit-39972530f241498707afde36919a65852d72bcb2.tar.lz craftbukkit-39972530f241498707afde36919a65852d72bcb2.tar.xz craftbukkit-39972530f241498707afde36919a65852d72bcb2.zip |
Added VEHICLE_DESTROY event
Diffstat (limited to 'src/main/java/net/minecraft/server/EntityBoat.java')
-rw-r--r-- | src/main/java/net/minecraft/server/EntityBoat.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/main/java/net/minecraft/server/EntityBoat.java b/src/main/java/net/minecraft/server/EntityBoat.java index b6072cfd..51f83379 100644 --- a/src/main/java/net/minecraft/server/EntityBoat.java +++ b/src/main/java/net/minecraft/server/EntityBoat.java @@ -9,6 +9,7 @@ import org.bukkit.craftbukkit.CraftWorld; import org.bukkit.entity.Vehicle; import org.bukkit.event.vehicle.VehicleCreateEvent; import org.bukkit.event.vehicle.VehicleDamageEvent; +import org.bukkit.event.vehicle.VehicleDestroyEvent; import org.bukkit.event.vehicle.VehicleEnterEvent; import org.bukkit.event.vehicle.VehicleEntityCollisionEvent; import org.bukkit.event.vehicle.VehicleMoveEvent; @@ -116,6 +117,17 @@ public class EntityBoat extends Entity { this.a += i * 10; this.W(); if (this.a > 40) { + + // CraftBukkit start + VehicleDestroyEvent destroyEvent = new VehicleDestroyEvent(vehicle, attacker); + ((WorldServer) this.world).getServer().getPluginManager().callEvent(destroyEvent); + + if (destroyEvent.isCancelled()) { + this.a = 40; // Maximize damage so this doesn't get triggered again right away + return true; + } + // CraftBukkit end + int j; for (j = 0; j < 3; ++j) { |