mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-29 15:49:00 +01:00
Update Entity AddTo|RemoveFrom World events to be EntityEvents
This commit is contained in:
parent
53848cdc2f
commit
997285e344
1 changed files with 6 additions and 22 deletions
|
@ -15,6 +15,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+import org.bukkit.entity.Entity;
|
||||
+import org.bukkit.event.Event;
|
||||
+import org.bukkit.event.HandlerList;
|
||||
+import org.bukkit.event.entity.EntityEvent;
|
||||
+
|
||||
+/**
|
||||
+ * Fired any time an entity is being added to the world for any reason.
|
||||
|
@ -22,19 +23,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ * Not to be confused with {@link org.bukkit.event.entity.CreatureSpawnEvent}
|
||||
+ * This will fire anytime a chunk is reloaded too.
|
||||
+ */
|
||||
+public class EntityAddToWorldEvent extends Event {
|
||||
+public class EntityAddToWorldEvent extends EntityEvent {
|
||||
+
|
||||
+ private final Entity entity;
|
||||
+ public EntityAddToWorldEvent(Entity entity) {
|
||||
+ this.entity = entity;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Gets the entity being added to the world
|
||||
+ * @return
|
||||
+ */
|
||||
+ public Entity getEntity() {
|
||||
+ return entity;
|
||||
+ super(entity);
|
||||
+ }
|
||||
+
|
||||
+ private static final HandlerList handlers = new HandlerList();
|
||||
|
@ -58,23 +50,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+import org.bukkit.entity.Entity;
|
||||
+import org.bukkit.event.Event;
|
||||
+import org.bukkit.event.HandlerList;
|
||||
+import org.bukkit.event.entity.EntityEvent;
|
||||
+
|
||||
+/**
|
||||
+ * Fired any time an entity is being removed from a world for any reason
|
||||
+ */
|
||||
+public class EntityRemoveFromWorldEvent extends Event {
|
||||
+ private final Entity entity;
|
||||
+public class EntityRemoveFromWorldEvent extends EntityEvent {
|
||||
+
|
||||
+ public EntityRemoveFromWorldEvent(Entity entity) {
|
||||
+ this.entity = entity;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Gets the entity being removed from the world
|
||||
+ * @return
|
||||
+ */
|
||||
+ public Entity getEntity() {
|
||||
+ return entity;
|
||||
+ super(entity);
|
||||
+ }
|
||||
+
|
||||
+ private static final HandlerList handlers = new HandlerList();
|
||||
|
|
Loading…
Reference in a new issue