Class AreaOperation

java.lang.Object
com.ldtteam.structurize.operations.BaseOperation
com.ldtteam.structurize.operations.AreaOperation
All Implemented Interfaces:
ITickedWorldOperation
Direct Known Subclasses:
RemoveBlockOperation, RemoveFilteredOperation, ReplaceBlockOperation

public abstract class AreaOperation extends BaseOperation
Operations running on entire areas, require a start and end position and will iterate over the entire area.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected net.minecraft.core.BlockPos.MutableBlockPos
    The end position to iterate to.
    protected final net.minecraft.world.entity.player.Player
    The player who initiated the area operation.
    protected net.minecraft.core.BlockPos.MutableBlockPos
    The start position to iterate from.

    Fields inherited from class com.ldtteam.structurize.operations.BaseOperation

    storage
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    AreaOperation(net.minecraft.network.chat.Component storageText, net.minecraft.world.entity.player.Player player, List<net.minecraft.core.BlockPos> workPosList)
     
    protected
    AreaOperation(net.minecraft.network.chat.Component storageText, net.minecraft.world.entity.player.Player player, net.minecraft.core.BlockPos startPos, net.minecraft.core.BlockPos endPos)
    Default constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    apply(net.minecraft.server.level.ServerLevel world)
    Apply the operation on the world.
    protected abstract void
    apply(net.minecraft.server.level.ServerLevel world, net.minecraft.core.BlockPos position)
    Apply the operation on the world.

    Methods inherited from class com.ldtteam.structurize.operations.BaseOperation

    getChangeStorage

    Methods inherited from class java.lang.Object

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

    • player

      protected final net.minecraft.world.entity.player.Player player
      The player who initiated the area operation.
    • startPos

      protected net.minecraft.core.BlockPos.MutableBlockPos startPos
      The start position to iterate from.
    • endPos

      protected net.minecraft.core.BlockPos.MutableBlockPos endPos
      The end position to iterate to.
  • Constructor Details

    • AreaOperation

      protected AreaOperation(net.minecraft.network.chat.Component storageText, net.minecraft.world.entity.player.Player player, net.minecraft.core.BlockPos startPos, net.minecraft.core.BlockPos endPos)
      Default constructor.
      Parameters:
      storageText - the text for the change storage.
      player - the player who initiated the area operation.
      startPos - the start pos to iterate from.
      endPos - the end pos to iterate to.
    • AreaOperation

      protected AreaOperation(net.minecraft.network.chat.Component storageText, net.minecraft.world.entity.player.Player player, List<net.minecraft.core.BlockPos> workPosList)
  • Method Details

    • apply

      public final boolean apply(net.minecraft.server.level.ServerLevel world)
      Description copied from interface: ITickedWorldOperation
      Apply the operation on the world.
      Parameters:
      world - the world to apply them on.
      Returns:
      true if finished.
    • apply

      protected abstract void apply(net.minecraft.server.level.ServerLevel world, net.minecraft.core.BlockPos position)
      Apply the operation on the world.
      Parameters:
      world - the world to apply them on.
      position - the current area position.