blob: 708fa69ff9e21ca083dabaac5bd22b33829b7795 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
|
From 0d5ac1495027cf6c32f01657878ee208fafa1fdb 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
|