Class World

java.lang.Object
mindustry.core.World

public class World extends Object
  • Field Details

    • context

      public final mindustry.core.World.Context context
    • tiles

      public Tiles tiles
    • tileChanges

      public int tileChanges
      The number of times tiles have changed in this session. Used for blocks that need to poll world state, but not frequently.
  • Constructor Details

    • World

      public World()
  • Method Details

    • addMapLoader

      public void addMapLoader(Map map, Runnable loader)
      Adds a custom handler function for loading a custom map - usually a generated one.
    • isInvalidMap

      public boolean isInvalidMap()
    • solid

      public boolean solid(int x, int y)
    • passable

      public boolean passable(int x, int y)
    • wallSolid

      public boolean wallSolid(int x, int y)
    • wallSolidFull

      public boolean wallSolidFull(int x, int y)
    • isAccessible

      public boolean isAccessible(int x, int y)
    • width

      public int width()
    • height

      public int height()
    • unitWidth

      public int unitWidth()
    • unitHeight

      public int unitHeight()
    • floor

      public Floor floor(int x, int y)
    • floorWorld

      public Floor floorWorld(float x, float y)
    • tile

      @Nullable public Tile tile(int pos)
    • tile

      @Nullable public Tile tile(int x, int y)
    • tileBuilding

      @Nullable public Tile tileBuilding(int x, int y)
    • build

      @Nullable public mindustry.gen.Building build(int x, int y)
    • build

      @Nullable public mindustry.gen.Building build(int pos)
    • rawTile

      public Tile rawTile(int x, int y)
    • tileWorld

      @Nullable public Tile tileWorld(float x, float y)
    • buildWorld

      @Nullable public mindustry.gen.Building buildWorld(float x, float y)
    • conv

      public static float conv(float coord)
      Convert from world to logic tile coordinates. Whole numbers are at centers of tiles.
    • unconv

      public static float unconv(float coord)
      Convert from tile to world coordinates.
    • toTile

      public static int toTile(float coord)
    • packArray

      public int packArray(int x, int y)
    • clearBuildings

      public void clearBuildings()
    • resize

      public Tiles resize(int width, int height)
      Resizes the tile array to the specified size and returns the resulting tile array. Only use for loading saves!
    • beginMapLoad

      public void beginMapLoad()
      Call to signify the beginning of map loading. TileEvents will not be fired until endMapLoad().
    • endMapLoad

      public void endMapLoad()
      Call to signify the end of map loading. Updates tile proximities and sets up physics for the world. A WorldLoadEvent will be fire.
    • getQuadBounds

      public Rect getQuadBounds(Rect in)
    • setGenerating

      public void setGenerating(boolean gen)
    • isGenerating

      public boolean isGenerating()
    • loadGenerator

      public void loadGenerator(int width, int height, Cons<Tiles> generator)
    • loadSector

      public void loadSector(Sector sector)
    • loadSector

      public void loadSector(Sector sector, int seedOffset, boolean saveInfo)
    • filterContext

      public mindustry.core.World.Context filterContext(Map map)
    • loadMap

      public void loadMap(Map map)
    • loadMap

      public void loadMap(Map map, Rules checkRules)
    • addDarkness

      public void addDarkness(Tiles tiles)
    • getWallDarkness

      public byte getWallDarkness(Tile tile)
    • checkMapArea

      public void checkMapArea()
    • getDarkness

      public float getDarkness(int x, int y)
    • raycastEachWorld

      public static void raycastEachWorld(float x0, float y0, float x1, float y1, Geometry.Raycaster cons)
    • raycastEach

      public static void raycastEach(int x1, int y1, int x2, int y2, Geometry.Raycaster cons)
    • raycast

      public static boolean raycast(int x1, int y1, int x2, int y2, Geometry.Raycaster cons)