|
1 | 1 | package su.nightexpress.quantumrpg.api.event; |
2 | 2 |
|
3 | 3 | import org.bukkit.entity.LivingEntity; |
| 4 | +import org.bukkit.event.Cancellable; |
| 5 | +import org.bukkit.event.Event; |
| 6 | +import org.bukkit.event.HandlerList; |
4 | 7 | import org.bukkit.inventory.ItemStack; |
5 | 8 | import org.jetbrains.annotations.NotNull; |
6 | | - |
7 | | -import su.nexmedia.engine.manager.api.event.ICancellableEvent; |
8 | 9 | import su.nightexpress.quantumrpg.modules.api.QModuleDrop; |
9 | 10 |
|
10 | | -public class EntityRPGItemPickupEvent extends ICancellableEvent { |
11 | | - |
12 | | - private ItemStack item; |
13 | | - private LivingEntity entity; |
14 | | - private QModuleDrop<?> module; |
15 | | - |
16 | | - public EntityRPGItemPickupEvent( |
17 | | - @NotNull ItemStack item, |
18 | | - @NotNull LivingEntity entity, |
19 | | - @NotNull QModuleDrop<?> module |
20 | | - ) { |
21 | | - this.item = item; |
22 | | - this.entity = entity; |
23 | | - this.module = module; |
24 | | - } |
25 | | - |
26 | | - @NotNull |
27 | | - public ItemStack getItem() { |
28 | | - return this.item; |
29 | | - } |
30 | | - |
31 | | - @NotNull |
32 | | - public LivingEntity getEntity() { |
33 | | - return this.entity; |
34 | | - } |
35 | | - |
36 | | - @NotNull |
37 | | - public QModuleDrop<?> getModule() { |
38 | | - return this.module; |
39 | | - } |
| 11 | +public class EntityRPGItemPickupEvent extends Event implements Cancellable { |
| 12 | + private static final HandlerList handlers = new HandlerList(); |
| 13 | + |
| 14 | + private boolean cancelled; |
| 15 | + |
| 16 | + private ItemStack item; |
| 17 | + |
| 18 | + private LivingEntity li; |
| 19 | + |
| 20 | + private QModuleDrop<?> module; |
| 21 | + |
| 22 | + public EntityRPGItemPickupEvent(@NotNull ItemStack item, @NotNull LivingEntity li, @NotNull QModuleDrop<?> module) { |
| 23 | + this.item = item; |
| 24 | + this.li = li; |
| 25 | + this.module = module; |
| 26 | + } |
| 27 | + |
| 28 | + public static HandlerList getHandlerList() { |
| 29 | + return handlers; |
| 30 | + } |
| 31 | + |
| 32 | + @NotNull |
| 33 | + public HandlerList getHandlers() { |
| 34 | + return handlers; |
| 35 | + } |
| 36 | + |
| 37 | + public boolean isCancelled() { |
| 38 | + return this.cancelled; |
| 39 | + } |
| 40 | + |
| 41 | + public void setCancelled(boolean cancelled) { |
| 42 | + this.cancelled = cancelled; |
| 43 | + } |
| 44 | + |
| 45 | + @NotNull |
| 46 | + public ItemStack getItem() { |
| 47 | + return this.item; |
| 48 | + } |
| 49 | + |
| 50 | + @NotNull |
| 51 | + public LivingEntity getEntity() { |
| 52 | + return this.li; |
| 53 | + } |
| 54 | + |
| 55 | + @NotNull |
| 56 | + public QModuleDrop<?> getModule() { |
| 57 | + return this.module; |
| 58 | + } |
40 | 59 | } |
0 commit comments