Prevent crash on dismount, thanks Salaman for the report!

This commit is contained in:
md_5 2013-07-05 10:44:38 +10:00
parent bc16626761
commit 81aee9fec2

View file

@ -1,18 +1,18 @@
From e87d5c46dc469f08b5fd0db8a06301fa83f9f78e Mon Sep 17 00:00:00 2001 From 27928f3910adc76ee6a1b59a7c4d0d9f521260d0 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au> From: md_5 <md_5@live.com.au>
Date: Tue, 2 Jul 2013 20:32:49 +1000 Date: Tue, 2 Jul 2013 20:32:49 +1000
Subject: [PATCH] Entity Mount and Dismount Events Subject: [PATCH] Entity Mount and Dismount Events
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 8fbf811..83f6730 100644 index 8fbf811..fe0b43a 100644
--- a/src/main/java/net/minecraft/server/Entity.java --- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java
@@ -1409,6 +1409,7 @@ public abstract class Entity { @@ -1409,6 +1409,7 @@ public abstract class Entity {
if ((this.bukkitEntity instanceof LivingEntity) && (this.vehicle.getBukkitEntity() instanceof Vehicle)) { if ((this.bukkitEntity instanceof LivingEntity) && (this.vehicle.getBukkitEntity() instanceof Vehicle)) {
VehicleExitEvent event = new VehicleExitEvent((Vehicle) this.vehicle.getBukkitEntity(), (LivingEntity) this.bukkitEntity); VehicleExitEvent event = new VehicleExitEvent((Vehicle) this.vehicle.getBukkitEntity(), (LivingEntity) this.bukkitEntity);
pluginManager.callEvent(event); pluginManager.callEvent(event);
+ pluginManager.callEvent( new org.spigotmc.event.entity.EntityDismountEvent( this.getBukkitEntity(), entity.getBukkitEntity() ) ); // Spigot + pluginManager.callEvent( new org.spigotmc.event.entity.EntityDismountEvent( this.getBukkitEntity(), this.vehicle.getBukkitEntity() ) ); // Spigot
} }
// CraftBukkit end // CraftBukkit end