Class ChangeStorage

java.lang.Object
com.ldtteam.structurize.util.ChangeStorage

public class ChangeStorage extends Object
Change storage to store changes to an area to be able to undo them.
  • Constructor Summary

    Constructors
    Constructor
    Description
    ChangeStorage(net.minecraft.network.chat.Component operation, UUID player)
    Initiate an empty changeStorage to manually fill it.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addEntities(List<net.minecraft.world.entity.Entity> list)
    Add entities to list to be readded.
    void
    addPostDataFor(net.minecraft.core.BlockPos place, net.minecraft.world.level.Level world)
    Add a position storage to the list.
    void
    addPreviousDataFor(net.minecraft.core.BlockPos place, net.minecraft.world.level.Level world)
    Add a position storage to the list.
    void
    addToBeKilledEntity(net.minecraft.world.entity.Entity entity)
    Add a entity to be killed to the list.
    int
    Get this change storages unique ID
    net.minecraft.network.chat.Component
    Get the operation of this changestorage
    Get the players ID
    boolean
    Check whether the current operation on this is done
    boolean
    redo(net.minecraft.world.level.Level world)
    Reload the previous state of the positions.
    void
    Resets the iteration
    boolean
    undo(net.minecraft.world.level.Level world, @Nullable ChangeStorage undoStorage)
    Reload the previous state of the positions.

    Methods inherited from class java.lang.Object

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

    • ChangeStorage

      public ChangeStorage(net.minecraft.network.chat.Component operation, UUID player)
      Initiate an empty changeStorage to manually fill it.
      Parameters:
      player - the player owner of it.
  • Method Details

    • addPreviousDataFor

      public void addPreviousDataFor(net.minecraft.core.BlockPos place, net.minecraft.world.level.Level world)
      Add a position storage to the list.
      Parameters:
      place - the place.
      world - the world.
    • addPostDataFor

      public void addPostDataFor(net.minecraft.core.BlockPos place, net.minecraft.world.level.Level world)
      Add a position storage to the list.
      Parameters:
      place - the place.
      world - the world.
    • addEntities

      public void addEntities(List<net.minecraft.world.entity.Entity> list)
      Add entities to list to be readded.
      Parameters:
      list - the list of entities.
    • addToBeKilledEntity

      public void addToBeKilledEntity(net.minecraft.world.entity.Entity entity)
      Add a entity to be killed to the list.
      Parameters:
      entity - the place.
    • undo

      public boolean undo(net.minecraft.world.level.Level world, @Nullable @Nullable ChangeStorage undoStorage)
      Reload the previous state of the positions.
      Parameters:
      world - the world to manipulate.
      undoStorage -
      Returns:
      true if successful.
    • redo

      public boolean redo(net.minecraft.world.level.Level world)
      Reload the previous state of the positions.
      Parameters:
      world - the world to manipulate.
      Returns:
      true if successful.
    • getOperation

      public net.minecraft.network.chat.Component getOperation()
      Get the operation of this changestorage
      Returns:
    • resetUnRedo

      public void resetUnRedo()
      Resets the iteration
    • isDone

      public boolean isDone()
      Check whether the current operation on this is done
      Returns:
    • getID

      public int getID()
      Get this change storages unique ID
      Returns:
    • getPlayerID

      public UUID getPlayerID()
      Get the players ID
      Returns: