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 Summary
ConstructorsConstructorDescriptionCreates a new citizen event.AbstractCitizenEvent(boolean includeInSummary, net.minecraft.core.BlockPos eventPos, String citizenName) Creates a new citizen event. -
Method Summary
Modifier and TypeMethodDescriptionvoiddeserialize(net.minecraft.network.FriendlyByteBuf buf) Deserializes this event from the givenFriendlyByteBuf.voiddeserializeNBT(net.minecraft.nbt.CompoundTag compound) Gets the name of the citizen causing this event.net.minecraft.core.BlockPosReturns the position at which this event occurred.voidserialize(net.minecraft.network.FriendlyByteBuf buf) Serializes this event to the givenFriendlyByteBuf.net.minecraft.nbt.CompoundTagvoidsetCitizenName(String citizenName) Sets the name of the citizen causing this event.voidsetEventPos(net.minecraft.core.BlockPos eventPos) Sets the position this event happened at.toString()Methods inherited from class com.minecolonies.core.colony.eventhooks.AbstractEvent
getDay, includeInSummary, setDayMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.minecolonies.api.colony.colonyEvents.descriptions.ICitizenEventDescription
toDisplayStringMethods inherited from interface com.minecolonies.api.colony.colonyEvents.descriptions.IColonyEventDescription
getDay, getEventTypeId, getName, getSummaryTranslationKey, includeInSummary, setDay
-
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:IColonyEventDescriptionReturns the position at which this event occurred.- Specified by:
getEventPosin interfaceIColonyEventDescription- Returns:
- the position at which this event occurred.
-
setEventPos
public void setEventPos(net.minecraft.core.BlockPos eventPos) Description copied from interface:IColonyEventDescriptionSets the position this event happened at.- Specified by:
setEventPosin interfaceIColonyEventDescription- Parameters:
eventPos- the position this event happened at.
-
getCitizenName
Description copied from interface:ICitizenEventDescriptionGets the name of the citizen causing this event.- Specified by:
getCitizenNamein interfaceICitizenEventDescription- Returns:
- the name of the citizen causing this event.
-
setCitizenName
Description copied from interface:ICitizenEventDescriptionSets the name of the citizen causing this event.- Specified by:
setCitizenNamein interfaceICitizenEventDescription- Parameters:
citizenName- the name of the citizen causing this event.
-
serializeNBT
public net.minecraft.nbt.CompoundTag serializeNBT()- Specified by:
serializeNBTin interfacenet.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>- Overrides:
serializeNBTin classAbstractEvent
-
deserializeNBT
public void deserializeNBT(net.minecraft.nbt.CompoundTag compound) - Specified by:
deserializeNBTin interfacenet.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>- Overrides:
deserializeNBTin classAbstractEvent
-
serialize
public void serialize(net.minecraft.network.FriendlyByteBuf buf) Description copied from interface:IColonyEventDescriptionSerializes this event to the givenFriendlyByteBuf.- Specified by:
serializein interfaceIColonyEventDescription- Overrides:
serializein classAbstractEvent- Parameters:
buf- theFriendlyByteBufto serialize to.
-
deserialize
public void deserialize(net.minecraft.network.FriendlyByteBuf buf) Description copied from interface:IColonyEventDescriptionDeserializes this event from the givenFriendlyByteBuf.- Specified by:
deserializein interfaceIColonyEventDescription- Overrides:
deserializein classAbstractEvent- Parameters:
buf- theFriendlyByteBufto deserialize from.
-
toString
- Overrides:
toStringin classAbstractEvent
-