mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-03 09:19:38 +01:00
69 lines
3.1 KiB
Diff
69 lines
3.1 KiB
Diff
From 640d9af4079afb008d0e871446e87af89ff81387 Mon Sep 17 00:00:00 2001
|
|
From: Nik Gil <nikmanG@users.noreply.github.com>
|
|
Date: Mon, 1 Feb 2016 23:47:24 -0700
|
|
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 ef59b40..2da303f 100644
|
|
--- a/src/main/java/net/minecraft/server/Entity.java
|
|
+++ b/src/main/java/net/minecraft/server/Entity.java
|
|
@@ -33,6 +33,10 @@ import org.bukkit.event.entity.EntityPortalEvent;
|
|
import org.bukkit.plugin.PluginManager;
|
|
// CraftBukkit end
|
|
|
|
+// PaperSpigot start
|
|
+import org.spigotmc.event.entity.EntityDismountEvent;
|
|
+// PaperSpigot end
|
|
+
|
|
public abstract class Entity implements ICommandListener {
|
|
|
|
// CraftBukkit start
|
|
@@ -1576,7 +1580,11 @@ public abstract class Entity implements ICommandListener {
|
|
}
|
|
}
|
|
// CraftBukkit end
|
|
- pluginManager.callEvent( new org.spigotmc.event.entity.EntityDismountEvent( this.getBukkitEntity(), this.vehicle.getBukkitEntity() ) ); // Spigot
|
|
+ // PaperSpigot start - make EntityDismountEvent cancellable
|
|
+ EntityDismountEvent dismountEvent = new EntityDismountEvent(this.getBukkitEntity(), this.vehicle.getBukkitEntity()); // Spigot
|
|
+ pluginManager.callEvent(dismountEvent);
|
|
+ if (dismountEvent.isCancelled()) return;
|
|
+ // PaperSpigot end
|
|
this.setPositionRotation(this.vehicle.locX, this.vehicle.getBoundingBox().b + (double) this.vehicle.length, this.vehicle.locZ, this.yaw, this.pitch);
|
|
this.vehicle.passenger = null;
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
|
index 19a743c..c8b4e29 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
|
@@ -25,6 +25,11 @@ import org.bukkit.event.vehicle.VehicleExitEvent;
|
|
|
|
import co.aikar.timings.SpigotTimings; // Spigot
|
|
|
|
+// PaperSpigot start
|
|
+import org.bukkit.Bukkit;
|
|
+import org.spigotmc.event.entity.EntityDismountEvent;
|
|
+// PaperSpigot end
|
|
+
|
|
public abstract class EntityLiving extends Entity {
|
|
|
|
private static final UUID a = UUID.fromString("662A6B8D-DA3E-4C1C-8813-96EA6097278D");
|
|
@@ -1709,8 +1714,12 @@ public abstract class EntityLiving extends Entity {
|
|
}
|
|
}
|
|
// CraftBukkit end
|
|
- org.bukkit.Bukkit.getPluginManager().callEvent( new org.spigotmc.event.entity.EntityDismountEvent( this.getBukkitEntity(), this.vehicle.getBukkitEntity() ) ); // Spigot
|
|
-
|
|
+ // PaperSpigot start - make dismountEvent cancellable
|
|
+ EntityDismountEvent dismountEvent = new EntityDismountEvent(this.getBukkitEntity(), this.vehicle.getBukkitEntity()); // Spigot
|
|
+ Bukkit.getPluginManager().callEvent(dismountEvent);
|
|
+ if (dismountEvent.isCancelled()) return;
|
|
+ // PaperSpigot end
|
|
+
|
|
if (!this.world.isClientSide) {
|
|
this.q(this.vehicle);
|
|
}
|
|
--
|
|
2.7.0
|
|
|