Class AbstractCitizenEvent

java.lang.Object
com.minecolonies.core.colony.eventhooks.citizenEvents.AbstractCitizenEvent
All Implemented Interfaces:
ICitizenEventDescription, IColonyEventDescription, net.neoforged.neoforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
Direct Known Subclasses:
CitizenBornEvent, CitizenDiedEvent, CitizenGrownUpEvent, CitizenSpawnedEvent, VisitorSpawnedEvent

public abstract class AbstractCitizenEvent extends Object implements ICitizenEventDescription
Event for something happening to a citizen.
  • Constructor Details

    • AbstractCitizenEvent

      public AbstractCitizenEvent()
      Creates a new citizen event.
    • AbstractCitizenEvent

      public AbstractCitizenEvent(net.minecraft.core.BlockPos eventPos, String citizenName)
      Creates a new citizen event.
      Parameters:
      eventPos - the position of the hut block of the building.
      citizenName - the name of the building.
  • Method Details

    • getEventPos

      public net.minecraft.core.BlockPos getEventPos()
      Description copied from interface: IColonyEventDescription
      Returns the position at which this event occurred.
      Specified by:
      getEventPos in interface IColonyEventDescription
      Returns:
      the position at which this event occurred.
    • setEventPos

      public void setEventPos(net.minecraft.core.BlockPos eventPos)
      Description copied from interface: IColonyEventDescription
      Sets the position this event happened at.
      Specified by:
      setEventPos in interface IColonyEventDescription
      Parameters:
      eventPos - the position this event happened at.
    • getCitizenName

      public String getCitizenName()
      Description copied from interface: ICitizenEventDescription
      Gets the name of the citizen causing this event.
      Specified by:
      getCitizenName in interface ICitizenEventDescription
      Returns:
      the name of the citizen causing this event.
    • setCitizenName

      public void setCitizenName(String citizenName)
      Description copied from interface: ICitizenEventDescription
      Sets the name of the citizen causing this event.
      Specified by:
      setCitizenName in interface ICitizenEventDescription
      Parameters:
      citizenName - the name of the citizen causing this event.
    • serializeNBT

      public net.minecraft.nbt.CompoundTag serializeNBT(@NotNull net.minecraft.core.HolderLookup.Provider provider)
      Specified by:
      serializeNBT in interface net.neoforged.neoforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
    • deserializeNBT

      public void deserializeNBT(@NotNull net.minecraft.core.HolderLookup.Provider provider, net.minecraft.nbt.CompoundTag compound)
      Specified by:
      deserializeNBT in interface net.neoforged.neoforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
    • serialize

      public void serialize(net.minecraft.network.RegistryFriendlyByteBuf buf)
      Description copied from interface: IColonyEventDescription
      Serializes this event to the given RegistryFriendlyByteBuf.
      Specified by:
      serialize in interface IColonyEventDescription
      Parameters:
      buf - the RegistryFriendlyByteBuf to serialize to.
    • deserialize

      public void deserialize(net.minecraft.network.RegistryFriendlyByteBuf buf)
      Description copied from interface: IColonyEventDescription
      Deserializes this event from the given RegistryFriendlyByteBuf.
      Specified by:
      deserialize in interface IColonyEventDescription
      Parameters:
      buf - the RegistryFriendlyByteBuf to deserialize from.
    • toString

      public String toString()
      Overrides:
      toString in class Object