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
Event for something happening to a citizen.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new citizen event.AbstractCitizenEvent(net.minecraft.core.BlockPos eventPos, String citizenName) Creates a new citizen event. -
Method Summary
Modifier and TypeMethodDescriptionvoiddeserialize(net.minecraft.network.RegistryFriendlyByteBuf buf) Deserializes this event from the givenRegistryFriendlyByteBuf.voiddeserializeNBT(net.minecraft.core.HolderLookup.Provider provider, 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.RegistryFriendlyByteBuf buf) Serializes this event to the givenRegistryFriendlyByteBuf.net.minecraft.nbt.CompoundTagserializeNBT(net.minecraft.core.HolderLookup.Provider provider) voidsetCitizenName(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 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
getEventTypeId, getName
-
Constructor Details
-
AbstractCitizenEvent
public AbstractCitizenEvent()Creates a new citizen event. -
AbstractCitizenEvent
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(@NotNull net.minecraft.core.HolderLookup.Provider provider) - Specified by:
serializeNBTin interfacenet.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:
deserializeNBTin interfacenet.neoforged.neoforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
-
serialize
public void serialize(net.minecraft.network.RegistryFriendlyByteBuf buf) Description copied from interface:IColonyEventDescriptionSerializes this event to the givenRegistryFriendlyByteBuf.- Specified by:
serializein interfaceIColonyEventDescription- Parameters:
buf- theRegistryFriendlyByteBufto serialize to.
-
deserialize
public void deserialize(net.minecraft.network.RegistryFriendlyByteBuf buf) Description copied from interface:IColonyEventDescriptionDeserializes this event from the givenRegistryFriendlyByteBuf.- Specified by:
deserializein interfaceIColonyEventDescription- Parameters:
buf- theRegistryFriendlyByteBufto deserialize from.
-
toString
-