Class SchematicHandler

java.lang.Object
com.ryandw11.structure.schematic.SchematicHandler

public class SchematicHandler extends Object
Handles schematic operations.
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    compileOnly​(String name, org.bukkit.entity.Player player, org.bukkit.World w)
    Only compile a selection into a compiled schematic.
    static boolean
    createSchematic​(String name, org.bukkit.entity.Player player, org.bukkit.World w, boolean compile)
    Create a schematic and save it to the schematics folder in the CustomStructures plugin.
    static void
    placeSchematic​(org.bukkit.Location loc, String filename, boolean useAir, Structure structure)
    Handles the schematic.
    static void
    placeSchematic​(org.bukkit.Location loc, String filename, boolean useAir, Structure structure, int iteration)
    Handles the actual pasting of the structure.

    Methods inherited from class java.lang.Object

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

    • placeSchematic

      public static void placeSchematic(org.bukkit.Location loc, String filename, boolean useAir, Structure structure, int iteration) throws IOException, com.sk89q.worldedit.WorldEditException
      Handles the actual pasting of the structure.

      This method is to be called on the main Server thread.

      Parameters:
      loc - - The location
      filename - - The file name. Ex: demo.schematic
      useAir - - if air is to be used in the schematic
      structure - - The structure that is getting spawned.
      iteration - - The number of iterations in a structure.
      Throws:
      com.sk89q.worldedit.WorldEditException - If world edit has a problem pasting the schematic.
      IOException - If an error occurs during file reading.
    • placeSchematic

      public static void placeSchematic(org.bukkit.Location loc, String filename, boolean useAir, Structure structure) throws IOException, com.sk89q.worldedit.WorldEditException
      Handles the schematic.

      This method is to be called on the main Server thread.

      Parameters:
      loc - - The location
      filename - - The file name. Ex: demo.schematic
      useAir - - if air is to be used in the schematic
      structure - - The structure that is getting spawned.
      Throws:
      com.sk89q.worldedit.WorldEditException - If world edit has a problem pasting the schematic.
      IOException - If an error occurs during file reading.
    • createSchematic

      public static boolean createSchematic(String name, org.bukkit.entity.Player player, org.bukkit.World w, boolean compile)
      Create a schematic and save it to the schematics folder in the CustomStructures plugin.
      Parameters:
      name - The name of the schematic.
      player - The player.
      w - The world
      compile - If the schematic should be compiled.
      Returns:
      If the operation was successful.
    • compileOnly

      public static boolean compileOnly(String name, org.bukkit.entity.Player player, org.bukkit.World w)
      Only compile a selection into a compiled schematic.
      Parameters:
      name - The name of the schematic.
      player - The player.
      w - The world
      Returns:
      If the operation was successful.