Class AddRemoveRecipeMessage
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.AddRemoveRecipeMessage
- All Implemented Interfaces:
IMessage
Message class to add and remove recipes.
-
Constructor Summary
ConstructorsConstructorDescriptionEmpty default constructor.AddRemoveRecipeMessage(IBuildingView building, boolean remove, IRecipeStorage storage, int id) Create a message to add or remove recipes.AddRemoveRecipeMessage(IBuildingView building, List<ItemStorage> input, int gridSize, net.minecraft.world.item.ItemStack primaryOutput, boolean remove, net.minecraft.world.level.block.Block intermediary, int id) Create a message to add or remove recipes.AddRemoveRecipeMessage(IBuildingView building, List<ItemStorage> input, int gridSize, net.minecraft.world.item.ItemStack primaryOutput, List<net.minecraft.world.item.ItemStack> additionalOutputs, boolean remove, int id) Create a message to add or remove recipes. -
Method Summary
Modifier and TypeMethodDescriptionvoidfromBytesOverride(@NotNull net.minecraft.network.FriendlyByteBuf buf) Transformation from a byteStream.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
-
AddRemoveRecipeMessage
public AddRemoveRecipeMessage()Empty default constructor. -
AddRemoveRecipeMessage
public AddRemoveRecipeMessage(IBuildingView building, boolean remove, IRecipeStorage storage, int id) Create a message to add or remove recipes.- Parameters:
building- the building we're executing on.remove- true if remove.storage- the recipe storage.id- the unique id of the module.
-
AddRemoveRecipeMessage
public AddRemoveRecipeMessage(IBuildingView building, List<ItemStorage> input, int gridSize, net.minecraft.world.item.ItemStack primaryOutput, List<net.minecraft.world.item.ItemStack> additionalOutputs, boolean remove, int id) Create a message to add or remove recipes. This constructor creates the recipeStorage on its own.- Parameters:
input- the input.gridSize- the gridSize.primaryOutput- the primary output.remove- true if remove.building- the building we're executing on.id- module id.additionalOutputs- the additional outputs.
-
AddRemoveRecipeMessage
public AddRemoveRecipeMessage(IBuildingView building, List<ItemStorage> input, int gridSize, net.minecraft.world.item.ItemStack primaryOutput, boolean remove, net.minecraft.world.level.block.Block intermediary, int id) Create a message to add or remove recipes. This constructor creates the recipeStorage on its own.- Parameters:
input- the input.gridSize- the gridSize.primaryOutput- the primary output.remove- true if remove.building- the building we're executing on.intermediary- intermediate block.id- the module id.
-
-
Method Details
-
fromBytesOverride
public void fromBytesOverride(@NotNull @NotNull net.minecraft.network.FriendlyByteBuf buf) Transformation from a byteStream.- Specified by:
fromBytesOverridein classAbstractColonyServerMessage- Parameters:
buf- the used byteBuffer.
-
toBytesOverride
public void toBytesOverride(@NotNull @NotNull net.minecraft.network.FriendlyByteBuf buf) Transformation to a byteStream.- Specified by:
toBytesOverridein classAbstractColonyServerMessage- Parameters:
buf- the used byteBuffer.
-
onExecute
public void onExecute(net.minecraftforge.network.NetworkEvent.Context ctxIn, boolean isLogicalServer, IColony colony, IBuilding building) - Specified by:
onExecutein classAbstractBuildingServerMessage<IBuilding>
-