Class Schematics

java.lang.Object
mindustry.game.Schematics
All Implemented Interfaces:
Loadable

public class Schematics extends Object implements Loadable
Handles schematics.
  • Constructor Details

    • Schematics

      public Schematics()
  • Method Details

    • loadSync

      public void loadSync()
      Specified by:
      loadSync in interface Loadable
    • load

      public void load()
      Load all schematics in the folder immediately.
    • overwrite

      public void overwrite(Schematic target, Schematic newSchematic)
    • all

      public Seq<Schematic> all()
    • saveChanges

      public void saveChanges(Schematic s)
    • savePreview

      public void savePreview(Schematic schematic, Fi file)
    • getPreview

      public Texture getPreview(Schematic schematic)
    • hasPreview

      public boolean hasPreview(Schematic schematic)
    • getBuffer

      public FrameBuffer getBuffer(Schematic schematic)
    • toPlans

      public Seq<BuildPlan> toPlans(Schematic schem, int x, int y)
      Creates an array of build plans from a schematic's data, centered on the provided x+y coordinates.
    • getLoadouts

      public Seq<Schematic> getLoadouts(CoreBlock block)
      Returns:
      all the valid loadouts for a specific core type.
    • getLoadouts

      public ObjectMap<CoreBlock,Seq<Schematic>> getLoadouts()
    • getDefaultLoadout

      @Nullable public Schematic getDefaultLoadout(CoreBlock block)
    • isDefaultLoadout

      public boolean isDefaultLoadout(Schematic schem)
    • getMaxLaunchSize

      public int getMaxLaunchSize(Block block)
    • add

      public void add(Schematic schematic)
      Adds a schematic to the list, also copying it into the files.
    • remove

      public void remove(Schematic s)
    • create

      public Schematic create(int x, int y, int x2, int y2)
      Creates a schematic from a world selection.
    • writeBase64

      public String writeBase64(Schematic schematic)
      Converts a schematic to base64. Note that the result of this will always start with 'bXNjaAB'.
    • placeLaunchLoadout

      public static void placeLaunchLoadout(int x, int y)
      Places the last launch loadout at the coordinates and fills it with the launch resources.
    • placeLoadout

      public static void placeLoadout(Schematic schem, int x, int y)
    • placeLoadout

      public static void placeLoadout(Schematic schem, int x, int y, Team team)
    • placeLoadout

      public static void placeLoadout(Schematic schem, int x, int y, Team team, boolean check)
    • place

      public static void place(Schematic schem, int x, int y, Team team)
    • place

      public static void place(Schematic schem, int x, int y, Team team, boolean overwrite)
    • readBase64

      public static Schematic readBase64(String schematic)
      Loads a schematic from base64. May throw an exception.
    • read

      public static Schematic read(Fi file) throws IOException
      Throws:
      IOException
    • read

      public static Schematic read(InputStream input) throws IOException
      Throws:
      IOException
    • write

      public static void write(Schematic schematic, Fi file) throws IOException
      Throws:
      IOException
    • write

      public static void write(Schematic schematic, OutputStream output) throws IOException
      Throws:
      IOException
    • rotate

      public static Schematic rotate(Schematic input, int times)
      Returns:
      a temporary schematic representing the input rotated 90 degrees counterclockwise N times.