Class PosBasedInteraction
java.lang.Object
com.minecolonies.api.colony.interactionhandling.AbstractInteractionResponseHandler
com.minecolonies.core.colony.interactionhandling.ServerCitizenInteraction
com.minecolonies.core.colony.interactionhandling.PosBasedInteraction
- All Implemented Interfaces:
IInteractionResponseHandler,net.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
The position based interaction response handler.
-
Field Summary
Fields inherited from class com.minecolonies.core.colony.interactionhandling.ServerCitizenInteraction
parents, validatorId -
Constructor Summary
ConstructorsConstructorDescriptionPosBasedInteraction(ICitizen data) Way to load the response handler for a citizen.PosBasedInteraction(net.minecraft.network.chat.Component inquiry, IChatPriority priority, net.minecraft.core.BlockPos pos) The server interaction response handler.PosBasedInteraction(net.minecraft.network.chat.Component inquiry, IChatPriority priority, net.minecraft.network.chat.Component validator, net.minecraft.core.BlockPos pos) The server interaction response handler. -
Method Summary
Modifier and TypeMethodDescriptionvoiddeserializeNBT(@NotNull net.minecraft.nbt.CompoundTag compoundNBT) Deserialize the response handler from NBT.Gen all child interactions related to this.getType()Type id used to deserialize.booleanisValid(ICitizenData citizen) Check if this response handler is still valid.protected voidLoad the validator.net.minecraft.nbt.CompoundTagSerialize the response handler to NBT.Methods inherited from class com.minecolonies.core.colony.interactionhandling.ServerCitizenInteraction
addParent, getId, isVisible, onClientResponseTriggered, onServerResponseTriggered, removeParentMethods inherited from class com.minecolonies.api.colony.interactionhandling.AbstractInteractionResponseHandler
getInquiry, getPossibleResponses, getPriority, getResponseResult, isPrimaryMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.minecolonies.api.colony.interactionhandling.IInteractionResponseHandler
getInquiry, getInteractionIcon, onClosed, onOpened, onWindowOpened
-
Constructor Details
-
PosBasedInteraction
public PosBasedInteraction(net.minecraft.network.chat.Component inquiry, IChatPriority priority, net.minecraft.network.chat.Component validator, net.minecraft.core.BlockPos pos) The server interaction response handler.- Parameters:
inquiry- the client inquiry.priority- the interaction priority.pos- the pos this is related to.validator- the validator id.
-
PosBasedInteraction
public PosBasedInteraction(net.minecraft.network.chat.Component inquiry, IChatPriority priority, net.minecraft.core.BlockPos pos) The server interaction response handler.- Parameters:
inquiry- the client inquiry.priority- the interaction priority.pos- the pos this is related to.
-
PosBasedInteraction
Way to load the response handler for a citizen.- Parameters:
data- the citizen owning this handler.
-
-
Method Details
-
genChildInteractions
Description copied from interface:IInteractionResponseHandlerGen all child interactions related to this.- Returns:
- all child interactions.
-
isValid
Description copied from interface:IInteractionResponseHandlerCheck if this response handler is still valid.- Specified by:
isValidin interfaceIInteractionResponseHandler- Overrides:
isValidin classServerCitizenInteraction- Parameters:
citizen- the colony the citizen is in.- Returns:
- true if still valid, else false.
-
serializeNBT
public net.minecraft.nbt.CompoundTag serializeNBT()Description copied from class:AbstractInteractionResponseHandlerSerialize the response handler to NBT.- Specified by:
serializeNBTin interfacenet.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>- Overrides:
serializeNBTin classServerCitizenInteraction- Returns:
- the serialized data.
-
deserializeNBT
public void deserializeNBT(@NotNull @NotNull net.minecraft.nbt.CompoundTag compoundNBT) Description copied from class:AbstractInteractionResponseHandlerDeserialize the response handler from NBT.- Specified by:
deserializeNBTin interfacenet.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>- Overrides:
deserializeNBTin classServerCitizenInteraction
-
loadValidator
protected void loadValidator()Description copied from class:ServerCitizenInteractionLoad the validator.- Overrides:
loadValidatorin classServerCitizenInteraction
-
getType
Description copied from interface:IInteractionResponseHandlerType id used to deserialize.- Returns:
- the string type.
-