mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-05 10:20:53 +01:00
cab333b217
Don't send requests of every player was found in the global api cache SpigotMC/Spigot@841270ff1e Correctly set the response code for the cached lookups and return the ... SpigotMC/Spigot@f170b7899c Don't try and re-set the global api cache on reload SpigotMC/Spigot@b410a00a66 Use a compile time sneaky throw hack. SpigotMC/Spigot@508462b96b Fix a missed rename in WorldGenGroundBush SpigotMC/Spigot@0614d8fae9
113 lines
2.6 KiB
Diff
113 lines
2.6 KiB
Diff
From f04bd1caddf61581ced67d7fec409e25b6dec9b5 Mon Sep 17 00:00:00 2001
|
|
From: md_5 <md_5@live.com.au>
|
|
Date: Tue, 2 Jul 2013 20:32:53 +1000
|
|
Subject: [PATCH] Entity Mount and Dismount Events
|
|
|
|
|
|
diff --git a/src/main/java/org/spigotmc/event/entity/EntityDismountEvent.java b/src/main/java/org/spigotmc/event/entity/EntityDismountEvent.java
|
|
new file mode 100644
|
|
index 0000000..24d4942
|
|
--- /dev/null
|
|
+++ b/src/main/java/org/spigotmc/event/entity/EntityDismountEvent.java
|
|
@@ -0,0 +1,39 @@
|
|
+package org.spigotmc.event.entity;
|
|
+
|
|
+import org.bukkit.entity.Entity;
|
|
+import org.bukkit.event.HandlerList;
|
|
+import org.bukkit.event.entity.EntityEvent;
|
|
+
|
|
+/**
|
|
+ * Called when an entity stops riding another entity.
|
|
+ *
|
|
+ */
|
|
+public class EntityDismountEvent extends EntityEvent
|
|
+{
|
|
+
|
|
+ private static final HandlerList handlers = new HandlerList();
|
|
+ private boolean cancelled;
|
|
+ private final Entity dismounted;
|
|
+
|
|
+ public EntityDismountEvent(Entity what, Entity dismounted)
|
|
+ {
|
|
+ super( what );
|
|
+ this.dismounted = dismounted;
|
|
+ }
|
|
+
|
|
+ public Entity getDismounted()
|
|
+ {
|
|
+ return dismounted;
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public HandlerList getHandlers()
|
|
+ {
|
|
+ return handlers;
|
|
+ }
|
|
+
|
|
+ public static HandlerList getHandlerList()
|
|
+ {
|
|
+ return handlers;
|
|
+ }
|
|
+}
|
|
diff --git a/src/main/java/org/spigotmc/event/entity/EntityMountEvent.java b/src/main/java/org/spigotmc/event/entity/EntityMountEvent.java
|
|
new file mode 100644
|
|
index 0000000..16aa2a7
|
|
--- /dev/null
|
|
+++ b/src/main/java/org/spigotmc/event/entity/EntityMountEvent.java
|
|
@@ -0,0 +1,52 @@
|
|
+package org.spigotmc.event.entity;
|
|
+
|
|
+import org.bukkit.entity.Entity;
|
|
+import org.bukkit.event.Cancellable;
|
|
+import org.bukkit.event.HandlerList;
|
|
+import org.bukkit.event.entity.EntityEvent;
|
|
+
|
|
+/**
|
|
+ * Called when an entity attempts to ride another entity.
|
|
+ *
|
|
+ */
|
|
+public class EntityMountEvent extends EntityEvent implements Cancellable
|
|
+{
|
|
+
|
|
+ private static final HandlerList handlers = new HandlerList();
|
|
+ private boolean cancelled;
|
|
+ private final Entity mount;
|
|
+
|
|
+ public EntityMountEvent(Entity what, Entity mount)
|
|
+ {
|
|
+ super( what );
|
|
+ this.mount = mount;
|
|
+ }
|
|
+
|
|
+ public Entity getMount()
|
|
+ {
|
|
+ return mount;
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public boolean isCancelled()
|
|
+ {
|
|
+ return cancelled;
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public void setCancelled(boolean cancel)
|
|
+ {
|
|
+ this.cancelled = cancel;
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public HandlerList getHandlers()
|
|
+ {
|
|
+ return handlers;
|
|
+ }
|
|
+
|
|
+ public static HandlerList getHandlerList()
|
|
+ {
|
|
+ return handlers;
|
|
+ }
|
|
+}
|
|
--
|
|
1.9.1
|
|
|