Class ToggleRecipeMessage
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.worker.ToggleRecipeMessage
- All Implemented Interfaces:
IMessage
Message to toggle recipes (enable/disable).
-
Constructor Summary
ConstructorsConstructorDescriptionEmpty public constructor.ToggleRecipeMessage(@NotNull IBuildingView building, int location, int id) Creates message for player to enable/disable a recipe. -
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, IBuilding 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
-
ToggleRecipeMessage
public ToggleRecipeMessage()Empty public constructor. -
ToggleRecipeMessage
Creates message for player to enable/disable a recipe.- Parameters:
building- view of the building to read data fromlocation- the recipeLocation.id- the unique id of the crafting module.
-
-
Method Details
-
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.
-
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.
-
onExecute
protected void onExecute(net.minecraftforge.network.NetworkEvent.Context ctxIn, boolean isLogicalServer, IColony colony, IBuilding building) - Specified by:
onExecutein classAbstractBuildingServerMessage<IBuilding>
-