Class BuildToolPlacementMessage
java.lang.Object
com.ldtteam.structurize.network.messages.BuildToolPlacementMessage
- All Implemented Interfaces:
IMessage
Send build tool data to the server. Verify the data on the server side and then place the blueprint.
This also buffers the incoming messages, places one per tick and loads the file off-thread.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumType of button. -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal Stringbooleanfinal Stringfinal net.minecraft.world.level.block.Mirrornet.minecraft.server.level.ServerPlayerfinal net.minecraft.core.BlockPosfinal net.minecraft.world.level.block.Rotationfinal StringStructure placement info.Identify the Client side handler.net.minecraft.world.level.LevelCached placement info. -
Constructor Summary
ConstructorsConstructorDescriptionBuildToolPlacementMessage(BlueprintSyncMessage msg, net.minecraft.server.level.ServerPlayer player, net.minecraft.world.level.Level world) Create a placement message from the sync message.BuildToolPlacementMessage(BuildToolPlacementMessage.HandlerType type, String handlerId, String structurePackId, String blueprintPath, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.Rotation rotation, net.minecraft.world.level.block.Mirror mirror) Send placement data to the server.BuildToolPlacementMessage(net.minecraft.network.FriendlyByteBuf buf) Buffer reading message constructor. -
Method Summary
Modifier and TypeMethodDescription@Nullable net.minecraftforge.fml.LogicalSideWhich sides is message able to be executed at.voidonExecute(net.minecraftforge.network.NetworkEvent.Context ctxIn, boolean isLogicalServer) Executes message action.voidtoBytes(net.minecraft.network.FriendlyByteBuf buf) Writes this packet to aByteBuf.
-
Field Details
-
type
Identify the Client side handler. -
handlerId
-
structurePackId
Structure placement info. -
blueprintPath
-
pos
public final net.minecraft.core.BlockPos pos -
rotation
public final net.minecraft.world.level.block.Rotation rotation -
mirror
public final net.minecraft.world.level.block.Mirror mirror -
world
public net.minecraft.world.level.Level worldCached placement info. -
player
public net.minecraft.server.level.ServerPlayer player -
clientPack
public boolean clientPack
-
-
Constructor Details
-
BuildToolPlacementMessage
public BuildToolPlacementMessage(net.minecraft.network.FriendlyByteBuf buf) Buffer reading message constructor. -
BuildToolPlacementMessage
public BuildToolPlacementMessage(BuildToolPlacementMessage.HandlerType type, String handlerId, String structurePackId, String blueprintPath, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.Rotation rotation, net.minecraft.world.level.block.Mirror mirror) Send placement data to the server.- Parameters:
type- the type of placement.handlerId- additional handler meta data.structurePackId- the id of the pack.blueprintPath- the path of the structure in the pack.pos- the position of the blueprint.rotation- the rotation of the blueprint.mirror- the mirror of the blueprint.
-
BuildToolPlacementMessage
public BuildToolPlacementMessage(BlueprintSyncMessage msg, net.minecraft.server.level.ServerPlayer player, net.minecraft.world.level.Level world) Create a placement message from the sync message.- Parameters:
msg- the sync message.
-
-
Method Details
-
toBytes
public void toBytes(net.minecraft.network.FriendlyByteBuf buf) Writes this packet to aByteBuf. -
getExecutionSide
@Nullable public @Nullable net.minecraftforge.fml.LogicalSide getExecutionSide()Description copied from interface:IMessageWhich sides is message able to be executed at.- Specified by:
getExecutionSidein interfaceIMessage- Returns:
- CLIENT or SERVER or null (for both)
-
onExecute
public void onExecute(net.minecraftforge.network.NetworkEvent.Context ctxIn, boolean isLogicalServer) Description copied from interface:IMessageExecutes message action.
-