Class SortBuildingMessage
java.lang.Object
com.minecolonies.core.network.messages.server.AbstractColonyServerMessage
com.minecolonies.core.network.messages.server.AbstractBuildingServerMessage<IBuilding>
com.minecolonies.core.network.messages.server.colony.building.warehouse.SortBuildingMessage
- All Implemented Interfaces:
IMessage
Sort the specified building inventory if the building allows it.
-
Constructor Summary
ConstructorsConstructorDescriptionEmpty constructor used when registering the messageSortBuildingMessage(IBuildingView building) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidfromBytesOverride(net.minecraft.network.FriendlyByteBuf buf) Transformation from a byteStream to the variables.protected voidonExecute(net.minecraftforge.network.NetworkEvent.Context ctxIn, boolean isLogicalServer, IColony colony, IBuilding building) Sort the building's inventory if it can be sorted.protected voidtoBytesOverride(net.minecraft.network.FriendlyByteBuf buf) Transformation to a byteStream.Methods inherited from class com.minecolonies.core.network.messages.server.AbstractBuildingServerMessage
errorIfCastFails, fromBytesAbstractOverride, onExecute, toBytesAbstractOverrideMethods inherited from class com.minecolonies.core.network.messages.server.AbstractColonyServerMessage
fromBytes, getExecutionSide, onExecute, ownerOnly, permissionNeeded, toBytes
-
Constructor Details
-
SortBuildingMessage
public SortBuildingMessage()Empty constructor used when registering the message -
SortBuildingMessage
-
-
Method Details
-
toBytesOverride
protected void toBytesOverride(net.minecraft.network.FriendlyByteBuf buf) Description copied from class:AbstractColonyServerMessageTransformation to a byteStream.- Specified by:
toBytesOverridein classAbstractColonyServerMessage- Parameters:
buf- the used byteBuffer.
-
fromBytesOverride
protected void fromBytesOverride(net.minecraft.network.FriendlyByteBuf buf) Description copied from class:AbstractColonyServerMessageTransformation from a byteStream to the variables.- Specified by:
fromBytesOverridein classAbstractColonyServerMessage- Parameters:
buf- the used byteBuffer.
-
onExecute
protected void onExecute(net.minecraftforge.network.NetworkEvent.Context ctxIn, boolean isLogicalServer, IColony colony, IBuilding building) Sort the building's inventory if it can be sorted.- Specified by:
onExecutein classAbstractBuildingServerMessage<IBuilding>- Parameters:
ctxIn- the context of the network eventisLogicalServer- whether or not this is the logical servercolony- the colony which the building is inbuilding- the building to sort
-