3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-15 12:30:06 +01:00
Paper/Spigot-Server-Patches/0063-Made-EntityDismountEvent-Cancellable.patch
2016-03-03 04:07:25 -06:00

34 Zeilen
1.5 KiB
Diff

From 1bed4e4301f897bbbfe538ff9fe93aa1d183c175 Mon Sep 17 00:00:00 2001
From: Nik Gil <nikmanG@users.noreply.github.com>
Date: Thu, 3 Mar 2016 04:04:19 -0600
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
index b0aef4c..a6dde74 100644
--- 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 {
@@ -1735,6 +1736,11 @@ public abstract class Entity implements ICommandListener {
}
// CraftBukkit end
Bukkit.getPluginManager().callEvent( new org.spigotmc.event.entity.EntityDismountEvent(entity.getBukkitEntity(), this.getBukkitEntity())); // Spigot
+ // 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;
}
--
2.7.2