mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-08 01:17:47 +01:00
Add traits to EntityEquipEvent
This commit is contained in:
parent
3b80335134
commit
74d323126f
@ -2,11 +2,12 @@ package net.minestom.server.event.item;
|
||||
|
||||
import net.minestom.server.entity.Entity;
|
||||
import net.minestom.server.entity.EquipmentSlot;
|
||||
import net.minestom.server.event.Event;
|
||||
import net.minestom.server.event.trait.EntityEvent;
|
||||
import net.minestom.server.event.trait.ItemEvent;
|
||||
import net.minestom.server.item.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class EntityEquipEvent implements Event {
|
||||
public class EntityEquipEvent implements EntityEvent, ItemEvent {
|
||||
|
||||
private final Entity entity;
|
||||
private ItemStack equippedItem;
|
||||
@ -18,13 +19,7 @@ public class EntityEquipEvent implements Event {
|
||||
this.slot = slot;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public Entity getEntity() {
|
||||
return entity;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public ItemStack getEquippedItem() {
|
||||
public @NotNull ItemStack getEquippedItem() {
|
||||
return equippedItem;
|
||||
}
|
||||
|
||||
@ -32,8 +27,20 @@ public class EntityEquipEvent implements Event {
|
||||
this.equippedItem = armorItem;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public EquipmentSlot getSlot() {
|
||||
public @NotNull EquipmentSlot getSlot() {
|
||||
return slot;
|
||||
}
|
||||
|
||||
/**
|
||||
* Same as {@link #getEquippedItem()}.
|
||||
*/
|
||||
@Override
|
||||
public @NotNull ItemStack getItemStack() {
|
||||
return equippedItem;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Entity getEntity() {
|
||||
return entity;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user