Class BuildingDeconstructedEvent
java.lang.Object
com.minecolonies.core.colony.eventhooks.AbstractEvent
com.minecolonies.core.colony.eventhooks.buildingEvents.AbstractBuildingEvent
com.minecolonies.core.colony.eventhooks.buildingEvents.BuildingDeconstructedEvent
- All Implemented Interfaces:
IBuildingEventDescription,IColonyEventDescription,net.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
The event handling a building being deconstructed.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final net.minecraft.resources.ResourceLocationThis events id, registry entries use res locations as ids. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new building deconstructed event.BuildingDeconstructedEvent(net.minecraft.core.BlockPos eventPos, String buildingName, int buildingLevel) Creates a new building deconstructed event. -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.resources.ResourceLocationGets this event types registry id.getName()Gets the name of this event type.static BuildingDeconstructedEventloadFromFriendlyByteBuf(@NotNull net.minecraft.network.FriendlyByteBuf buf) Loads the citizen born event from the given packet buffer.static BuildingDeconstructedEventloadFromNBT(@NotNull net.minecraft.nbt.CompoundTag compound) Loads the citizen born event from the given nbt.Methods inherited from class com.minecolonies.core.colony.eventhooks.buildingEvents.AbstractBuildingEvent
deserialize, deserializeNBT, getBuildingName, getEventPos, getLevel, serialize, serializeNBT, setBuildingName, setEventPos, setLevel, toStringMethods 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, getSummaryTranslationKey, includeInSummary, setDay
-
Field Details
-
BUILDING_DECONSTRUCTED_EVENT_ID
public static final net.minecraft.resources.ResourceLocation BUILDING_DECONSTRUCTED_EVENT_IDThis events id, registry entries use res locations as ids.
-
-
Constructor Details
-
BuildingDeconstructedEvent
public BuildingDeconstructedEvent()Creates a new building deconstructed event. -
BuildingDeconstructedEvent
public BuildingDeconstructedEvent(net.minecraft.core.BlockPos eventPos, String buildingName, int buildingLevel) Creates a new building deconstructed event.- Parameters:
eventPos- the position of the hut block of the building.buildingName- the name of the building.buildingLevel- the level of the building before this event.
-
-
Method Details
-
getEventTypeId
public net.minecraft.resources.ResourceLocation getEventTypeId()Description copied from interface:IColonyEventDescriptionGets this event types registry id.- Returns:
- this event types registry id.
-
getName
Description copied from interface:IColonyEventDescriptionGets the name of this event type.- Returns:
- the name of this event type.
-
loadFromNBT
public static BuildingDeconstructedEvent loadFromNBT(@NotNull @NotNull net.minecraft.nbt.CompoundTag compound) Loads the citizen born event from the given nbt.- Parameters:
compound- the NBT compound- Returns:
- the colony to load.
-
loadFromFriendlyByteBuf
public static BuildingDeconstructedEvent loadFromFriendlyByteBuf(@NotNull @NotNull net.minecraft.network.FriendlyByteBuf buf) Loads the citizen born event from the given packet buffer.- Parameters:
buf- the packet buffer.- Returns:
- the colony to load.
-