mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-06 16:37:38 +01:00
Add remaining filters
This commit is contained in:
parent
6cbc31b114
commit
d58cd3b578
@ -3,8 +3,10 @@ package net.minestom.server.event;
|
||||
import net.minestom.server.entity.Entity;
|
||||
import net.minestom.server.entity.Player;
|
||||
import net.minestom.server.event.handler.EventHandler;
|
||||
import net.minestom.server.event.trait.EntityEvent;
|
||||
import net.minestom.server.event.trait.PlayerEvent;
|
||||
import net.minestom.server.event.trait.*;
|
||||
import net.minestom.server.instance.Instance;
|
||||
import net.minestom.server.inventory.Inventory;
|
||||
import net.minestom.server.item.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@ -15,6 +17,9 @@ public interface EventFilter<E extends Event, H> {
|
||||
EventFilter<Event, EventHandler> ALL = from(Event.class);
|
||||
EventFilter<EntityEvent, Entity> ENTITY = from(EntityEvent.class, Entity.class, EntityEvent::getEntity);
|
||||
EventFilter<PlayerEvent, Player> PLAYER = from(PlayerEvent.class, Player.class, PlayerEvent::getPlayer);
|
||||
EventFilter<ItemEvent, ItemStack> ITEM = from(ItemEvent.class, ItemStack.class, ItemEvent::getItemStack);
|
||||
EventFilter<InstanceEvent, Instance> INSTANCE = from(InstanceEvent.class, Instance.class, InstanceEvent::getInstance);
|
||||
EventFilter<InventoryEvent, Inventory> INVENTORY = from(InventoryEvent.class, Inventory.class, InventoryEvent::getInventory);
|
||||
|
||||
static <E extends Event, H> EventFilter<E, H> from(@NotNull Class<E> eventType,
|
||||
@NotNull Class<H> handlerType,
|
||||
|
Loading…
Reference in New Issue
Block a user