Class ColonyEventTypeRegistryEntry

java.lang.Object
com.minecolonies.api.colony.colonyEvents.registry.ColonyEventTypeRegistryEntry

public class ColonyEventTypeRegistryEntry extends Object
This is the colonies event registry entry class, used for registering any colony related events. Takes a function of colony, nbt to create the right event object.
  • Constructor Summary

    Constructors
    Constructor
    Description
    ColonyEventTypeRegistryEntry(@NotNull org.apache.commons.lang3.function.TriFunction<IColony,net.minecraft.nbt.CompoundTag,net.minecraft.core.HolderLookup.Provider,IColonyEvent> eventCreator, @NotNull net.minecraft.resources.ResourceLocation registryID)
    Creates a new registry entry for the given function and registry name
    ColonyEventTypeRegistryEntry(@NotNull org.apache.commons.lang3.function.TriFunction<IColony,net.minecraft.nbt.CompoundTag,net.minecraft.core.HolderLookup.Provider,IColonyEvent> eventCreator, @NotNull net.minecraft.resources.ResourceLocation registryID, boolean isRaidEvent)
    Creates a new registry entry for the given function and registry name
  • Method Summary

    Modifier and Type
    Method
    Description
    deserializeEvent(IColony colony, net.minecraft.core.HolderLookup.Provider provider, net.minecraft.nbt.CompoundTag compound)
    Deserializes the event from nbt.
    net.minecraft.resources.ResourceLocation
    Get the fitting registry name.
    boolean
    Check whether this is a raid event or not.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ColonyEventTypeRegistryEntry

      public ColonyEventTypeRegistryEntry(@NotNull @NotNull org.apache.commons.lang3.function.TriFunction<IColony,net.minecraft.nbt.CompoundTag,net.minecraft.core.HolderLookup.Provider,IColonyEvent> eventCreator, @NotNull @NotNull net.minecraft.resources.ResourceLocation registryID)
      Creates a new registry entry for the given function and registry name
      Parameters:
      eventCreator - the event creator.
      registryID - the registry id.
    • ColonyEventTypeRegistryEntry

      public ColonyEventTypeRegistryEntry(@NotNull @NotNull org.apache.commons.lang3.function.TriFunction<IColony,net.minecraft.nbt.CompoundTag,net.minecraft.core.HolderLookup.Provider,IColonyEvent> eventCreator, @NotNull @NotNull net.minecraft.resources.ResourceLocation registryID, boolean isRaidEvent)
      Creates a new registry entry for the given function and registry name
      Parameters:
      eventCreator - the event creator.
      registryID - the registry id.
      isRaidEvent - whether this is a raid event (must extend from IColonyRaidEvent)
  • Method Details

    • deserializeEvent

      public IColonyEvent deserializeEvent(@Nonnull IColony colony, @NotNull net.minecraft.core.HolderLookup.Provider provider, @Nonnull net.minecraft.nbt.CompoundTag compound)
      Deserializes the event from nbt.
      Parameters:
      colony - the colony this event is part of.
      compound - the nbt to deserialize the event from.
      Returns:
      the deserialized event.
    • getRegistryName

      public net.minecraft.resources.ResourceLocation getRegistryName()
      Get the fitting registry name.
      Returns:
      the name.
    • isRaidEvent

      public boolean isRaidEvent()
      Check whether this is a raid event or not.
      Returns:
      true if so.