Class Manager

java.lang.Object
com.ldtteam.structurize.management.Manager

public final class Manager extends Object
Singleton class that links colonies to minecraft.
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    Add a new item to the scanTool operation queue.
    static void
    Add a new item to the queue.
    static Blueprint
    generateRandomShape(int height, int width, int length, String equation, net.minecraft.world.level.block.state.BlockState block)
    Randomly generates shape based on an equation.
    Returns a list of the recently cached operations for this player
    static Blueprint
    getStructureFromFormula(int width, int length, int height, int frequency, String equation, Shape shape, net.minecraft.world.item.ItemStack inputBlock, net.minecraft.world.item.ItemStack inputFillBlock, boolean hollow)
    Just returns a cube for now, I can tinker this later.
    static boolean
    Whether or not a new schematic have been downloaded.
    static void
    onWorldTick(net.minecraft.server.level.ServerLevel world)
    Method called on world tick to run cached operations.
    static void
    pasteStructure(net.minecraft.server.level.ServerLevel server, net.minecraft.core.BlockPos pos, int width, int length, int height, int frequency, String equation, Shape shape, net.minecraft.world.item.ItemStack inputBlock, net.minecraft.world.item.ItemStack inputFillBlock, boolean hollow, net.minecraft.server.level.ServerPlayer player, RotationMirror rotMir)
    Paste a structure into the world.
    static void
    redo(net.minecraft.world.entity.player.Player player, int operationID)
    Undo a change to the world made by a player.
    static void
    setSchematicDownloaded(boolean downloaded)
    Set the schematic downloaded
    static void
    undo(net.minecraft.world.entity.player.Player player, int operationID)
    Undo a change to the world made by a player.

    Methods inherited from class java.lang.Object

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

    • onWorldTick

      public static void onWorldTick(net.minecraft.server.level.ServerLevel world)
      Method called on world tick to run cached operations.
      Parameters:
      world - the world which is ticking.
    • addToQueue

      public static void addToQueue(ITickedWorldOperation operation)
      Add a new item to the scanTool operation queue.
      Parameters:
      operation - the operation to add.
    • addToUndoRedoCache

      public static void addToUndoRedoCache(ChangeStorage storage)
      Add a new item to the queue.
      Parameters:
      storage - the storage to add.
    • getChangeStoragesForPlayer

      public static List<ChangeStorage> getChangeStoragesForPlayer(UUID player)
      Returns a list of the recently cached operations for this player
      Parameters:
      player -
      Returns:
    • pasteStructure

      public static void pasteStructure(net.minecraft.server.level.ServerLevel server, net.minecraft.core.BlockPos pos, int width, int length, int height, int frequency, String equation, Shape shape, net.minecraft.world.item.ItemStack inputBlock, net.minecraft.world.item.ItemStack inputFillBlock, boolean hollow, net.minecraft.server.level.ServerPlayer player, RotationMirror rotMir)
      Paste a structure into the world.
      Parameters:
      server - the server world.
      pos - the position.
      width - the width.
      length - the length.
      height - the height.
      frequency - the frequency.
      equation - the equation.
      shape - the shape.
      inputBlock - the input block.
      inputFillBlock - the fill block.
      hollow - if hollow or not.
      player - the player.
      rotMir - the mirror and the rotation.
    • getStructureFromFormula

      public static Blueprint getStructureFromFormula(int width, int length, int height, int frequency, String equation, Shape shape, net.minecraft.world.item.ItemStack inputBlock, net.minecraft.world.item.ItemStack inputFillBlock, boolean hollow)
      Just returns a cube for now, I can tinker this later.
      Parameters:
      width - the width.
      length - the length.
      height - the height.
      frequency - the frequency.
      equation - the equation.
      shape - the shape.
      inputBlock - the input block.
      inputFillBlock - the fill block.
      hollow - if hollow or not.
      Returns:
      the new blueprint.
    • generateRandomShape

      public static Blueprint generateRandomShape(int height, int width, int length, String equation, net.minecraft.world.level.block.state.BlockState block)
      Randomly generates shape based on an equation.
      Parameters:
      height - the height.
      width - the width.
      length - the length.
      equation - the equation.
      block - the block.
      Returns:
      the created blueprint
    • undo

      public static void undo(net.minecraft.world.entity.player.Player player, int operationID)
      Undo a change to the world made by a player.
      Parameters:
      player - the player who made it.
      operationID -
    • redo

      public static void redo(net.minecraft.world.entity.player.Player player, int operationID)
      Undo a change to the world made by a player.
      Parameters:
      player - the player who made it.
      operationID -
    • isSchematicDownloaded

      public static boolean isSchematicDownloaded()
      Whether or not a new schematic have been downloaded.
      Returns:
      True if a new schematic have been received.
    • setSchematicDownloaded

      public static void setSchematicDownloaded(boolean downloaded)
      Set the schematic downloaded
      Parameters:
      downloaded - True if a new schematic have been received.