Class OpenBuildWindowMessage

java.lang.Object
com.minecolonies.core.network.messages.client.OpenBuildWindowMessage
All Implemented Interfaces:
IMessage
Direct Known Subclasses:
OpenDecoBuildWindowMessage, OpenPlantationFieldBuildWindowMessage

public abstract class OpenBuildWindowMessage extends Object implements IMessage
Message to open the build window, for example for decorations.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected boolean
    If mirrored.
    protected String
    The structure pack name.
    protected String
    The colony name.
    protected net.minecraft.core.BlockPos
    Town hall position to create building on.
    protected net.minecraft.world.level.block.Rotation
    The rotation.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
     
    protected
    OpenBuildWindowMessage(net.minecraft.core.BlockPos pos, String packName, String path, net.minecraft.world.level.block.Rotation rotation, net.minecraft.world.level.block.Mirror mirror)
    Create a new message.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected abstract IMessage
    createWorkOrderMessage(net.minecraft.core.BlockPos builder)
     
    void
    fromBytes(net.minecraft.network.FriendlyByteBuf buf)
    Reads message data from buffer.
    final @NotNull net.minecraftforge.fml.LogicalSide
    Which sides is message able to be executed at.
    final void
    onExecute(net.minecraftforge.network.NetworkEvent.Context ctxIn, boolean isLogicalServer)
    Executes message action.
    void
    toBytes(net.minecraft.network.FriendlyByteBuf buf)
    Writes message data to buffer.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • pos

      protected net.minecraft.core.BlockPos pos
      Town hall position to create building on.
    • path

      protected String path
      The colony name.
    • packName

      protected String packName
      The structure pack name.
    • rotation

      protected net.minecraft.world.level.block.Rotation rotation
      The rotation.
    • mirror

      protected boolean mirror
      If mirrored.
  • Constructor Details

    • OpenBuildWindowMessage

      protected OpenBuildWindowMessage()
    • OpenBuildWindowMessage

      protected OpenBuildWindowMessage(net.minecraft.core.BlockPos pos, String packName, String path, net.minecraft.world.level.block.Rotation rotation, net.minecraft.world.level.block.Mirror mirror)
      Create a new message.
      Parameters:
      pos - the position the deco will be anchored at.
      packName - the pack of the deco.
      path - the path in the pack.
  • Method Details

    • toBytes

      public void toBytes(net.minecraft.network.FriendlyByteBuf buf)
      Description copied from interface: IMessage
      Writes message data to buffer.
      Specified by:
      toBytes in interface IMessage
      Parameters:
      buf - network data byte buffer
    • fromBytes

      public void fromBytes(net.minecraft.network.FriendlyByteBuf buf)
      Description copied from interface: IMessage
      Reads message data from buffer.
      Specified by:
      fromBytes in interface IMessage
      Parameters:
      buf - network data byte buffer
    • getExecutionSide

      @NotNull public final @NotNull net.minecraftforge.fml.LogicalSide getExecutionSide()
      Description copied from interface: IMessage
      Which sides is message able to be executed at.
      Specified by:
      getExecutionSide in interface IMessage
      Returns:
      CLIENT or SERVER or null (for both)
    • onExecute

      public final void onExecute(net.minecraftforge.network.NetworkEvent.Context ctxIn, boolean isLogicalServer)
      Description copied from interface: IMessage
      Executes message action.
      Specified by:
      onExecute in interface IMessage
      Parameters:
      ctxIn - network context of incoming message
      isLogicalServer - whether message arrived at logical server side
    • createWorkOrderMessage

      protected abstract IMessage createWorkOrderMessage(net.minecraft.core.BlockPos builder)