Class ColonyEventTypeRegistryEntry
java.lang.Object
com.minecolonies.api.colony.colonyEvents.registry.ColonyEventTypeRegistryEntry
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
ConstructorsConstructorDescriptionColonyEventTypeRegistryEntry(@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 nameColonyEventTypeRegistryEntry(@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 TypeMethodDescriptiondeserializeEvent(IColony colony, net.minecraft.core.HolderLookup.Provider provider, net.minecraft.nbt.CompoundTag compound) Deserializes the event from nbt.net.minecraft.resources.ResourceLocationGet the fitting registry name.booleanCheck whether this is a raid event or not.
-
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.
-