Commits

md_5 authored 309497c12f5
Add EntityMountEvent and EntityDismount Event

Adapted from Spigot commit ab1e1a2a5ae1e6cc42afe8bf48832721407365fd.
No tags

src/main/java/org/bukkit/event/entity/EntityDismountEvent.java

Added
1 +package org.bukkit.event.entity;
2 +
3 +import org.bukkit.entity.Entity;
4 +import org.bukkit.event.Cancellable;
5 +import org.bukkit.event.HandlerList;
6 +import org.jetbrains.annotations.NotNull;
7 +
8 +/**
9 + * Called when an entity stops riding another entity.
10 + */
11 +public class EntityDismountEvent extends EntityEvent implements Cancellable {
12 +
13 + private static final HandlerList handlers = new HandlerList();
14 + private boolean cancelled;
15 + private final Entity dismounted;
16 +
17 + public EntityDismountEvent(@NotNull Entity what, @NotNull Entity dismounted) {
18 + super(what);
19 + this.dismounted = dismounted;
20 + }
21 +
22 + /**
23 + * Gets the entity which will no longer be ridden.
24 + *
25 + * @return dismounted entity
26 + */
27 + @NotNull
28 + public Entity getDismounted() {
29 + return dismounted;
30 + }
31 +
32 + @Override
33 + public boolean isCancelled() {
34 + return cancelled;
35 + }
36 +
37 + @Override
38 + public void setCancelled(boolean cancel) {
39 + this.cancelled = cancel;
40 + }
41 +
42 + @NotNull
43 + @Override
44 + public HandlerList getHandlers() {
45 + return handlers;
46 + }
47 +
48 + @NotNull
49 + public static HandlerList getHandlerList() {
50 + return handlers;
51 + }
52 +}

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut