Class WorldEditHandler

java.lang.Object
us.talabrek.ultimateskyblock.handler.WorldEditHandler

public class WorldEditHandler extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    clearIsland(@NotNull org.bukkit.World islandWorld, @NotNull com.sk89q.worldguard.protection.regions.ProtectedRegion region, @Nullable Runnable afterDeletion)
     
    static com.sk89q.worldedit.EditSession
    createEditSession(com.sk89q.worldedit.world.World bukkitWorld, int maxBlocks)
     
    static Set<com.sk89q.worldedit.regions.Region>
    getBorderRegions(com.sk89q.worldedit.regions.Region region)
    Returns a collection of regions covering the borders of the original region.
    static Set<com.sk89q.worldedit.math.BlockVector2>
    getChunks(com.sk89q.worldedit.regions.Region region)
     
    static Set<com.sk89q.worldedit.math.BlockVector2>
    getInnerChunks(com.sk89q.worldedit.regions.Region region)
    Returns all the chunks that are fully contained within the region.
    static Set<com.sk89q.worldedit.math.BlockVector2>
    getOuterChunks(com.sk89q.worldedit.regions.Region region)
     
    static com.sk89q.worldedit.regions.Region
    getRegion(org.bukkit.World skyWorld, com.sk89q.worldguard.protection.regions.ProtectedRegion region)
     
    static boolean
     
    static void
    loadIslandSchematic(File file, org.bukkit.Location origin, PlayerPerk playerPerk)
     
    static void
    loadRegion(org.bukkit.Location location)
     
    static void
    refreshRegion(org.bukkit.Location location)
     
    static void
    unloadRegion(org.bukkit.Location location)
     

    Methods inherited from class java.lang.Object

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

    • WorldEditHandler

      public WorldEditHandler()
  • Method Details

    • loadIslandSchematic

      public static void loadIslandSchematic(File file, org.bukkit.Location origin, PlayerPerk playerPerk)
    • getInnerChunks

      public static Set<com.sk89q.worldedit.math.BlockVector2> getInnerChunks(com.sk89q.worldedit.regions.Region region)
      Returns all the chunks that are fully contained within the region.
    • getOuterChunks

      public static Set<com.sk89q.worldedit.math.BlockVector2> getOuterChunks(com.sk89q.worldedit.regions.Region region)
    • getChunks

      public static Set<com.sk89q.worldedit.math.BlockVector2> getChunks(com.sk89q.worldedit.regions.Region region)
    • getBorderRegions

      public static Set<com.sk89q.worldedit.regions.Region> getBorderRegions(com.sk89q.worldedit.regions.Region region)
      Returns a collection of regions covering the borders of the original region. Note: complements the #getInnerChunks
           ^
           |           +---+---+---+---+---+---+
           |           |   |   |   |   |   |   |
           |           |   |   |   |   |   |   |
           |           +---+---+---+---+---+---+
           |         l |   | D=======C |   |   |
           |           |   | I |   | I |   |   |
           |         k +---+-I-R---Q-I-+---+---+
           |           |   | I |   | I |   |   |
           |           |   | I |   | I |   |   |
           |         j +---+-I-O---P-I-+---+---+
           |           |   | I |   | I |   |   |
           |         i |   | A=======B |   |   |
           |           +---+---+---+---+---+---+
           |                 a b   c d
           +----------------------------------------->
      
       Points:
           A = (a,i)
           B = (d,i)
           C = (d,l)
           D = (a,l)
      
           M(x) = X mod 16, i.e. Mc = C mod 16.
      
       Borders:
           O = A + 16 - Ma   | A > 0
             = A - Ma        | A <= 0
      
           Q = C - Mc - 1    | C > 0 && Mc != 15
             = C + Mc - 16   | C < 0 && Mc != -1
       
    • clearIsland

      public static void clearIsland(@NotNull @NotNull org.bukkit.World islandWorld, @NotNull @NotNull com.sk89q.worldguard.protection.regions.ProtectedRegion region, @Nullable @Nullable Runnable afterDeletion)
    • getRegion

      public static com.sk89q.worldedit.regions.Region getRegion(org.bukkit.World skyWorld, com.sk89q.worldguard.protection.regions.ProtectedRegion region)
    • isOuterPossible

      public static boolean isOuterPossible()
    • loadRegion

      public static void loadRegion(org.bukkit.Location location)
    • unloadRegion

      public static void unloadRegion(org.bukkit.Location location)
    • refreshRegion

      public static void refreshRegion(org.bukkit.Location location)
    • createEditSession

      public static com.sk89q.worldedit.EditSession createEditSession(com.sk89q.worldedit.world.World bukkitWorld, int maxBlocks)