Class PostBoxRequestMessage
java.lang.Object
com.minecolonies.core.network.messages.server.AbstractColonyServerMessage
com.minecolonies.core.network.messages.server.AbstractBuildingServerMessage<PostBox>
com.minecolonies.core.network.messages.server.colony.building.postbox.PostBoxRequestMessage
- All Implemented Interfaces:
IMessage
Creates a request from the postbox.
-
Constructor Summary
ConstructorsConstructorDescriptionEmpty constructor used when registering thePostBoxRequestMessage(@NotNull IBuildingView building, net.minecraft.world.item.ItemStack itemStack, int quantity, boolean deliverAvailable) Creates a Transfer Items request -
Method Summary
Modifier and TypeMethodDescriptionvoidfromBytesOverride(@NotNull net.minecraft.network.FriendlyByteBuf buf) Transformation from a byteStream to the variables.protected voidonExecute(net.minecraftforge.network.NetworkEvent.Context ctxIn, boolean isLogicalServer, IColony colony, PostBox building) voidtoBytesOverride(@NotNull 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
-
PostBoxRequestMessage
public PostBoxRequestMessage()Empty constructor used when registering the -
PostBoxRequestMessage
public PostBoxRequestMessage(@NotNull @NotNull IBuildingView building, net.minecraft.world.item.ItemStack itemStack, int quantity, boolean deliverAvailable) Creates a Transfer Items request- Parameters:
building- AbstractBuilding of the request.itemStack- to be take from the player for the buildingquantity- of item needed to be transfered
-
-
Method Details
-
toBytesOverride
public void toBytesOverride(@NotNull @NotNull net.minecraft.network.FriendlyByteBuf buf) Description copied from class:AbstractColonyServerMessageTransformation to a byteStream.- Specified by:
toBytesOverridein classAbstractColonyServerMessage- Parameters:
buf- the used byteBuffer.
-
fromBytesOverride
public void fromBytesOverride(@NotNull @NotNull 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, PostBox building) - Specified by:
onExecutein classAbstractBuildingServerMessage<PostBox>
-