Class ColonyEventDescriptionTypeRegistryEntry

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

public class ColonyEventDescriptionTypeRegistryEntry 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 Details

    • ColonyEventDescriptionTypeRegistryEntry

      public ColonyEventDescriptionTypeRegistryEntry(@NotNull @NotNull BiFunction<net.minecraft.core.HolderLookup.Provider,net.minecraft.nbt.CompoundTag,IColonyEventDescription> nbtEventCreator, @NotNull @NotNull Function<net.minecraft.network.RegistryFriendlyByteBuf,IColonyEventDescription> packetBufferEventCreator, @NotNull @NotNull net.minecraft.resources.ResourceLocation registryID)
      Creates a new registry entry for the given function and registry name.
      Parameters:
      nbtEventCreator - the event creator using nbt.
      packetBufferEventCreator - the event creator using a RegistryFriendlyByteBuf.
      registryID - the registry id.
  • Method Details

    • deserializeEventDescriptionFromNBT

      public IColonyEventDescription deserializeEventDescriptionFromNBT(@NotNull net.minecraft.core.HolderLookup.Provider provider, @Nonnull net.minecraft.nbt.CompoundTag compound)
      Deserializes the event description from nbt.
      Parameters:
      compound - the nbt to deserialize the event description from.
      Returns:
      the deserialized event description.
    • deserializeEventDescriptionFromFriendlyByteBuf

      public IColonyEventDescription deserializeEventDescriptionFromFriendlyByteBuf(@Nonnull net.minecraft.network.RegistryFriendlyByteBuf buffer)
      Deserializes the event description from the given RegistryFriendlyByteBuf.
      Parameters:
      buffer - the RegistryFriendlyByteBuf to deserialize the event description from.
      Returns:
      the deserialized event description.
    • getRegistryName

      public net.minecraft.resources.ResourceLocation getRegistryName()
      Get the set registry name.
      Returns:
      the name.