Search in sources :

Example 1 with IColonyEntitySpawnEvent

use of com.minecolonies.api.colony.colonyEvents.IColonyEntitySpawnEvent in project minecolonies by Minecolonies.

the class EventManager method registerEntity.

/**
 * Registers an entity with the given event.
 *
 * @param entity  the entity to register.
 * @param eventID the event id to register it to.
 */
@Override
public void registerEntity(@NotNull final Entity entity, final int eventID) {
    final IColonyEvent event = events.get(eventID);
    if (!(event instanceof IColonyEntitySpawnEvent)) {
        entity.remove();
        return;
    }
    ((IColonyEntitySpawnEvent) event).registerEntity(entity);
}
Also used : IColonyEvent(com.minecolonies.api.colony.colonyEvents.IColonyEvent) IColonyEntitySpawnEvent(com.minecolonies.api.colony.colonyEvents.IColonyEntitySpawnEvent)

Example 2 with IColonyEntitySpawnEvent

use of com.minecolonies.api.colony.colonyEvents.IColonyEntitySpawnEvent in project minecolonies by ldtteam.

the class EventManager method registerEntity.

/**
 * Registers an entity with the given event.
 *
 * @param entity  the entity to register.
 * @param eventID the event id to register it to.
 */
@Override
public void registerEntity(@NotNull final Entity entity, final int eventID) {
    final IColonyEvent event = events.get(eventID);
    if (!(event instanceof IColonyEntitySpawnEvent)) {
        entity.remove();
        return;
    }
    ((IColonyEntitySpawnEvent) event).registerEntity(entity);
}
Also used : IColonyEvent(com.minecolonies.api.colony.colonyEvents.IColonyEvent) IColonyEntitySpawnEvent(com.minecolonies.api.colony.colonyEvents.IColonyEntitySpawnEvent)

Aggregations

IColonyEntitySpawnEvent (com.minecolonies.api.colony.colonyEvents.IColonyEntitySpawnEvent)2 IColonyEvent (com.minecolonies.api.colony.colonyEvents.IColonyEvent)2