2016-04-22 20:45:22 +00:00
|
|
|
From 031f1df60d5934708755d7afe14817d30fdf8b4d Mon Sep 17 00:00:00 2001
|
2016-02-29 23:09:49 +00:00
|
|
|
From: Nik Gil <nikmanG@users.noreply.github.com>
|
2016-03-03 09:46:26 +00:00
|
|
|
Date: Thu, 3 Mar 2016 04:04:19 -0600
|
2016-02-29 23:09:49 +00:00
|
|
|
Subject: [PATCH] Made EntityDismountEvent Cancellable
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
2016-04-22 20:45:22 +00:00
|
|
|
index 782abd6..b15c5f6 100644
|
2016-02-29 23:09:49 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/Entity.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/Entity.java
|
2016-04-22 20:45:22 +00:00
|
|
|
@@ -1741,7 +1741,14 @@ public abstract class Entity implements ICommandListener {
|
2016-04-03 23:11:25 +00:00
|
|
|
}
|
2016-02-29 23:09:49 +00:00
|
|
|
}
|
|
|
|
// CraftBukkit end
|
2016-04-03 23:11:25 +00:00
|
|
|
- Bukkit.getPluginManager().callEvent( new org.spigotmc.event.entity.EntityDismountEvent(entity.getBukkitEntity(), this.getBukkitEntity())); // Spigot
|
2016-02-29 23:09:49 +00:00
|
|
|
+ // Paper start - make EntityDismountEvent cancellable
|
2016-04-22 20:45:22 +00:00
|
|
|
+ if (!new org.spigotmc.event.entity.EntityDismountEvent(entity.getBukkitEntity(), this.getBukkitEntity()).callEvent()) {
|
|
|
|
+ if (entity instanceof EntityPlayer) {
|
|
|
|
+ ((EntityPlayer) entity).playerConnection.sendPacket(new net.minecraft.server.PacketPlayOutMount(this));
|
|
|
|
+ }
|
|
|
|
+ return;
|
|
|
|
+ }
|
2016-02-29 23:09:49 +00:00
|
|
|
+ // Paper end
|
|
|
|
this.passengers.remove(entity);
|
|
|
|
entity.j = 60;
|
|
|
|
}
|
|
|
|
--
|
2016-03-31 00:50:23 +00:00
|
|
|
2.8.0
|
2016-02-29 23:09:49 +00:00
|
|
|
|