Class AbstractBuildingEvent
java.lang.Object
com.minecolonies.core.colony.eventhooks.AbstractEvent
com.minecolonies.core.colony.eventhooks.buildingEvents.AbstractBuildingEvent
- All Implemented Interfaces:
IBuildingEventDescription,IColonyEventDescription,net.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
- Direct Known Subclasses:
BuildingBuiltEvent,BuildingDeconstructedEvent,BuildingRepairedEvent,BuildingUpgradedEvent
public abstract class AbstractBuildingEvent
extends AbstractEvent
implements IBuildingEventDescription
The abstract event handling building/upgrading huts.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new building event.AbstractBuildingEvent(boolean includeInSummary, net.minecraft.core.BlockPos eventPos, String buildingName, int buildingLevel) Creates a new building 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 building type involved in this event.net.minecraft.core.BlockPosReturns the position at which this event occurred.intgetLevel()Gets the level of the building after the event.voidserialize(net.minecraft.network.FriendlyByteBuf buf) Serializes this event to the givenFriendlyByteBuf.net.minecraft.nbt.CompoundTagvoidsetBuildingName(String buildingName) Sets the building type for this event.voidsetEventPos(net.minecraft.core.BlockPos pos) Sets the position this event happened at.voidsetLevel(int lvl) Sets the level of the building after the event.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.IBuildingEventDescription
toDisplayStringMethods inherited from interface com.minecolonies.api.colony.colonyEvents.descriptions.IColonyEventDescription
getDay, getEventTypeId, getName, getSummaryTranslationKey, includeInSummary, setDay
-
Constructor Details
-
AbstractBuildingEvent
public AbstractBuildingEvent()Creates a new building event. -
AbstractBuildingEvent
public AbstractBuildingEvent(boolean includeInSummary, net.minecraft.core.BlockPos eventPos, String buildingName, int buildingLevel) Creates a new building event.- Parameters:
eventPos- the position of the hut block of the building.buildingName- the name of the building.buildingLevel- the level of the building after this event.
-
-
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 pos) Description copied from interface:IColonyEventDescriptionSets the position this event happened at.- Specified by:
setEventPosin interfaceIColonyEventDescription- Parameters:
pos- the position this event happened at.
-
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.
-
getBuildingName
Description copied from interface:IBuildingEventDescriptionGets the name of the building type involved in this event.- Specified by:
getBuildingNamein interfaceIBuildingEventDescription- Returns:
- the name of the building type involved in this event.
-
setBuildingName
Description copied from interface:IBuildingEventDescriptionSets the building type for this event.- Specified by:
setBuildingNamein interfaceIBuildingEventDescription- Parameters:
buildingName- the building type for this event.
-
getLevel
public int getLevel()Description copied from interface:IBuildingEventDescriptionGets the level of the building after the event.- Specified by:
getLevelin interfaceIBuildingEventDescription- Returns:
- the level of the building after the event.
-
setLevel
public void setLevel(int lvl) Description copied from interface:IBuildingEventDescriptionSets the level of the building after the event.- Specified by:
setLevelin interfaceIBuildingEventDescription- Parameters:
lvl- the level of the building after the event.
-
toString
- Overrides:
toStringin classAbstractEvent
-