Class BuildToolPlacementMessage

java.lang.Object
com.ldtteam.common.network.AbstractServerPlayMessage
com.ldtteam.structurize.network.messages.BuildToolPlacementMessage
All Implemented Interfaces:
com.ldtteam.common.network.IServerboundDistributor, net.minecraft.network.protocol.common.custom.CustomPacketPayload

public class BuildToolPlacementMessage extends com.ldtteam.common.network.AbstractServerPlayMessage
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 Classes
    Modifier and Type
    Class
    Description
    static enum 
    Type of button.

    Nested classes/interfaces inherited from interface net.minecraft.network.protocol.common.custom.CustomPacketPayload

    net.minecraft.network.protocol.common.custom.CustomPacketPayload.FallbackProvider<B extends net.minecraft.network.FriendlyByteBuf>, net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<T extends net.minecraft.network.protocol.common.custom.CustomPacketPayload>, net.minecraft.network.protocol.common.custom.CustomPacketPayload.TypeAndCodec<B extends net.minecraft.network.FriendlyByteBuf,T extends net.minecraft.network.protocol.common.custom.CustomPacketPayload>
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final String
     
    boolean
     
    final String
     
    net.minecraft.server.level.ServerPlayer
     
    final net.minecraft.core.BlockPos
     
     
    final String
    Structure placement info.
    Identify the Client side handler.
    static final com.ldtteam.common.network.PlayMessageType<?>
     
    net.minecraft.world.level.Level
    Cached placement info.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
     
    BuildToolPlacementMessage(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, RotationMirror rotMir)
    Send placement data to the server.
    protected
    BuildToolPlacementMessage(net.minecraft.network.RegistryFriendlyByteBuf buf, com.ldtteam.common.network.PlayMessageType<?> type)
    Buffer reading message constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    onExecute(net.neoforged.neoforge.network.handling.IPayloadContext context, net.minecraft.server.level.ServerPlayer player)
     
    protected void
    toBytes(net.minecraft.network.RegistryFriendlyByteBuf buf)
    Writes this packet to a ByteBuf.
    net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<?>
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface net.minecraft.network.protocol.common.custom.CustomPacketPayload

    toVanillaClientbound, toVanillaServerbound, type

    Methods inherited from interface com.ldtteam.common.network.IServerboundDistributor

    sendToServer
  • Field Details

    • TYPE

      public static final com.ldtteam.common.network.PlayMessageType<?> TYPE
    • type

      Identify the Client side handler.
    • handlerId

      public final String handlerId
    • structurePackId

      public final String structurePackId
      Structure placement info.
    • blueprintPath

      public final String blueprintPath
    • pos

      public final net.minecraft.core.BlockPos pos
    • rotationMirror

      public final RotationMirror rotationMirror
    • world

      public net.minecraft.world.level.Level world
      Cached placement info.
    • player

      public net.minecraft.server.level.ServerPlayer player
    • clientPack

      public boolean clientPack
  • Constructor Details

    • BuildToolPlacementMessage

      protected BuildToolPlacementMessage(net.minecraft.network.RegistryFriendlyByteBuf buf, com.ldtteam.common.network.PlayMessageType<?> type)
      Buffer reading message constructor.
    • BuildToolPlacementMessage

      public BuildToolPlacementMessage(BuildToolPlacementMessage.HandlerType type, String handlerId, String structurePackId, String blueprintPath, net.minecraft.core.BlockPos pos, RotationMirror rotMir)
      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.
      rotMir - the rotation and 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

      protected void toBytes(net.minecraft.network.RegistryFriendlyByteBuf buf)
      Writes this packet to a ByteBuf.
      Parameters:
      buf - The buffer being written to.
    • onExecute

      protected void onExecute(net.neoforged.neoforge.network.handling.IPayloadContext context, net.minecraft.server.level.ServerPlayer player)
      Specified by:
      onExecute in class com.ldtteam.common.network.AbstractServerPlayMessage
    • type

      public net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<?> type()
      Specified by:
      type in interface net.minecraft.network.protocol.common.custom.CustomPacketPayload