Class AbstractCitizenEvent

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

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

    • AbstractCitizenEvent

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

      public AbstractCitizenEvent(boolean includeInSummary, 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()
      Specified by:
      serializeNBT in interface net.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
      Overrides:
      serializeNBT in class AbstractEvent
    • deserializeNBT

      public void deserializeNBT(net.minecraft.nbt.CompoundTag compound)
      Specified by:
      deserializeNBT in interface net.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
      Overrides:
      deserializeNBT in class AbstractEvent
    • serialize

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

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

      public String toString()
      Overrides:
      toString in class AbstractEvent