Class AbstractEvent
java.lang.Object
com.minecolonies.core.colony.eventhooks.AbstractEvent
- All Implemented Interfaces:
IColonyEventDescription,net.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
- Direct Known Subclasses:
AbstractBuildingEvent,AbstractCitizenEvent
The abstract event handling building/upgrading huts.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new building event.AbstractEvent(boolean includeInSummary) Creates a new abstract event. -
Method Summary
Modifier and TypeMethodDescriptionvoiddeserialize(net.minecraft.network.FriendlyByteBuf buf) Deserializes this event from the givenFriendlyByteBuf.voiddeserializeNBT(net.minecraft.nbt.CompoundTag compound) intgetDay()Get the day the event occured.booleanIf the event should be included at the end of day summary.voidserialize(net.minecraft.network.FriendlyByteBuf buf) Serializes this event to the givenFriendlyByteBuf.net.minecraft.nbt.CompoundTagvoidsetDay(int day) Set the day it 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.IColonyEventDescription
getEventPos, getEventTypeId, getName, getSummaryTranslationKey, setEventPos, toDisplayString
-
Constructor Details
-
AbstractEvent
public AbstractEvent()Creates a new building event. -
AbstractEvent
public AbstractEvent(boolean includeInSummary) Creates a new abstract event.- Parameters:
includeInSummary-
-
-
Method Details
-
serializeNBT
public net.minecraft.nbt.CompoundTag serializeNBT()- Specified by:
serializeNBTin interfacenet.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
-
deserializeNBT
public void deserializeNBT(net.minecraft.nbt.CompoundTag compound) - Specified by:
deserializeNBTin interfacenet.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
-
serialize
public void serialize(net.minecraft.network.FriendlyByteBuf buf) Description copied from interface:IColonyEventDescriptionSerializes this event to the givenFriendlyByteBuf.- Specified by:
serializein interfaceIColonyEventDescription- 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- Parameters:
buf- theFriendlyByteBufto deserialize from.
-
includeInSummary
public boolean includeInSummary()Description copied from interface:IColonyEventDescriptionIf the event should be included at the end of day summary.- Specified by:
includeInSummaryin interfaceIColonyEventDescription- Returns:
- true if so.
-
getDay
public int getDay()Description copied from interface:IColonyEventDescriptionGet the day the event occured.- Specified by:
getDayin interfaceIColonyEventDescription- Returns:
- true.
-
setDay
public void setDay(int day) Description copied from interface:IColonyEventDescriptionSet the day it happened at.- Specified by:
setDayin interfaceIColonyEventDescription- Parameters:
day- the day.
-
toString
-