2016-03-29 01:01:42 +00:00
|
|
|
From 172117c0ef004434c7568f0bad02ebdf77390e48 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-03-29 01:01:42 +00:00
|
|
|
index c99b402..cc345d9 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
|
|
|
|
@@ -38,6 +38,7 @@ import org.bukkit.craftbukkit.event.CraftEventFactory;
|
|
|
|
import org.bukkit.event.entity.EntityCombustEvent;
|
|
|
|
import org.bukkit.event.entity.EntityPortalEvent;
|
|
|
|
import org.bukkit.plugin.PluginManager;
|
|
|
|
+import org.spigotmc.event.entity.EntityDismountEvent;
|
|
|
|
// CraftBukkit end
|
|
|
|
|
|
|
|
public abstract class Entity implements ICommandListener {
|
2016-03-25 16:32:09 +00:00
|
|
|
@@ -1750,6 +1751,11 @@ public abstract class Entity implements ICommandListener {
|
2016-02-29 23:09:49 +00:00
|
|
|
}
|
|
|
|
// CraftBukkit end
|
2016-03-03 09:46:26 +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
|
|
|
|
+ EntityDismountEvent dismountEvent = new EntityDismountEvent(this.getBukkitEntity(), entity.getBukkitEntity()); // Spigot
|
|
|
|
+ Bukkit.getPluginManager().callEvent(dismountEvent);
|
|
|
|
+ if (dismountEvent.isCancelled()) return;
|
|
|
|
+ // Paper end
|
|
|
|
this.passengers.remove(entity);
|
|
|
|
entity.j = 60;
|
|
|
|
}
|
|
|
|
--
|
2016-03-29 01:01:42 +00:00
|
|
|
2.7.4
|
2016-02-29 23:09:49 +00:00
|
|
|
|