Package mindustry.world
Class Tile
java.lang.Object
mindustry.world.Tile
- All Implemented Interfaces:
Position
,QuadTree.QuadTreeObject
,Displayable
- Direct Known Subclasses:
CachedTile
,EditorTile
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbyte
absoluteRelativeTo
(int cx, int cy) boolean
adjacentTo
(Tile tile) int
array()
block()
short
blockID()
boolean
static void
buildDestroyed
(mindustry.gen.Building build) static void
buildHealthUpdate
(IntSeq buildings) <T extends Block>
Tcblock()
int
centerX()
int
centerY()
protected void
changeBuild
(Team team, Prov<mindustry.gen.Building> entityprov, int rotation) protected void
changed()
void
void
void
boolean
void
float
drawx()
float
drawy()
drop()
protected void
protected void
floor()
short
floorID()
float
Returns the flammability of the tile.void
getLinkedTiles
(Cons<Tile> cons) Iterates through the list of all tiles linked to this multiblock, or just itself if it's not a multiblock.getLinkedTiles
(Seq<Tile> tmpArray) Returns the list of all tiles linked to this multiblock.void
getLinkedTilesAs
(Block block, Cons<Tile> tmpArray) Returns the list of all tiles linked to this multiblock if it were this block.getLinkedTilesAs
(Block block, Seq<Tile> tmpArray) Returns the list of all tiles linked to this multiblock if it were this block.int
float
getX()
float
getY()
void
Fills the out parameter with this element's rough bounding box.boolean
interactable
(Team team) boolean
isCenter()
boolean
boolean
boolean
legSolid()
nearby
(int rotation) nearby
(int dx, int dy) mindustry.gen.Building
nearbyBuild
(int rotation) overlay()
short
boolean
passable()
int
pos()
Returns this tile's position as a packed point.protected void
void
recache()
void
static int
relativeTo
(float x, float y, float cx, float cy) byte
relativeTo
(int cx, int cy) Return relative rotation to a coordinate.static byte
relativeTo
(int x, int y, int cx, int cy) byte
relativeTo
(Tile tile) void
remove()
void
remove()-s this tile, except it's synced across the networkstatic void
removeTile
(Tile tile) void
setAir()
Sets the block to air.void
void
void
void
void
This resets the overlay!static void
void
setFloorNet
(Block floor) set()-s this tile, except it's synced across the networkvoid
setFloorNet
(Block floor, Block overlay) set()-s this tile, except it's synced across the networkvoid
setFloorUnder
(Floor floor) Sets the floor, preserving overlay.void
set()-s this tile, except it's synced across the networkvoid
set()-s this tile, except it's synced across the networkvoid
setOverlay
(Block block) static void
setOverlay
(Tile tile, Block overlay) void
setOverlayID
(short ore) void
setOverlayNet
(Block overlay) set()-s this tile, except it's synced across the networkvoid
setOverlayQuiet
(Block block) Sets the overlay without a recache.void
Do not call unless you know what you are doing! This does not update the indexer!static void
static void
boolean
solid()
int
boolean
Whether this block was placed by a player/unit.team()
toString()
wallDrop()
float
worldx()
float
worldy()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface mindustry.ui.Displayable
displayable
-
Field Details
-
data
public byte dataExtra data for very specific blocks. -
build
Tile entity, usually null. -
x
public short x -
y
public short y -
block
-
floor
-
overlay
-
changing
protected boolean changing
-
-
Constructor Details
-
Tile
public Tile(int x, int y) -
Tile
-
Tile
public Tile(int x, int y, int floor, int overlay, int wall)
-
-
Method Details
-
pos
public int pos()Returns this tile's position as a packed point. -
array
public int array()- Returns:
- this tile's position, packed to the world width - for use in width*height arrays.
-
relativeTo
-
relativeTo
public byte relativeTo(int cx, int cy) Return relative rotation to a coordinate. Returns -1 if the coordinate is not near this tile. -
relativeTo
public static byte relativeTo(int x, int y, int cx, int cy) -
relativeTo
public static int relativeTo(float x, float y, float cx, float cy) -
absoluteRelativeTo
public byte absoluteRelativeTo(int cx, int cy) -
getFlammability
public float getFlammability()Returns the flammability of the tile. Used for fire calculations. Takes flammability of floor liquid into account. -
worldx
public float worldx() -
worldy
public float worldy() -
drawx
public float drawx() -
drawy
public float drawy() -
isDarkened
public boolean isDarkened() -
floor
-
block
-
overlay
-
cblock
-
team
-
setTeam
Do not call unless you know what you are doing! This does not update the indexer! -
isCenter
public boolean isCenter() -
centerX
public int centerX() -
centerY
public int centerY() -
getTeamID
public int getTeamID() -
setBlock
-
setBlock
-
setBlock
-
setBlock
-
setFloor
This resets the overlay! -
isEditorTile
public boolean isEditorTile() -
setFloorUnder
Sets the floor, preserving overlay. -
setAir
public void setAir()Sets the block to air. -
circle
-
circle
-
recacheWall
public void recacheWall() -
recache
public void recache() -
remove
public void remove() -
removeNet
public void removeNet()remove()-s this tile, except it's synced across the network -
setNet
set()-s this tile, except it's synced across the network -
setNet
set()-s this tile, except it's synced across the network -
setFloorNet
set()-s this tile, except it's synced across the network -
setFloorNet
set()-s this tile, except it's synced across the network -
setOverlayNet
set()-s this tile, except it's synced across the network -
overlayID
public short overlayID() -
blockID
public short blockID() -
floorID
public short floorID() -
setOverlayID
public void setOverlayID(short ore) -
setOverlay
-
setOverlayQuiet
Sets the overlay without a recache. -
clearOverlay
public void clearOverlay() -
passable
public boolean passable() -
synthetic
public boolean synthetic()Whether this block was placed by a player/unit. -
solid
public boolean solid() -
breakable
public boolean breakable() -
dangerous
public boolean dangerous()- Returns:
- whether the floor on this tile deals damage or can be drowned on.
-
getLinkedTiles
Iterates through the list of all tiles linked to this multiblock, or just itself if it's not a multiblock. The result contains all linked tiles, including this tile itself. -
getLinkedTiles
Returns the list of all tiles linked to this multiblock. This array contains all linked tiles, including this tile itself. -
getLinkedTilesAs
Returns the list of all tiles linked to this multiblock if it were this block. The result contains all linked tiles, including this tile itself. -
getLinkedTilesAs
Returns the list of all tiles linked to this multiblock if it were this block. The result contains all linked tiles, including this tile itself. -
getHitbox
-
getBounds
-
hitbox
Description copied from interface:QuadTree.QuadTreeObject
Fills the out parameter with this element's rough bounding box. This should never be smaller than the actual object, but may be larger.- Specified by:
hitbox
in interfaceQuadTree.QuadTreeObject
-
nearby
-
nearby
-
nearby
-
nearbyBuild
-
interactable
-
drop
-
wallDrop
-
staticDarkness
public int staticDarkness() -
legSolid
public boolean legSolid()- Returns:
- whether this tile is solid for legged units
-
adjacentTo
- Returns:
- true if these tiles are right next to each other.
-
preChanged
protected void preChanged() -
changeBuild
-
changed
protected void changed() -
fireChanged
protected void fireChanged() -
firePreChanged
protected void firePreChanged() -
display
- Specified by:
display
in interfaceDisplayable
-
getX
public float getX() -
getY
public float getY() -
toString
-
setFloor
-
setOverlay
-
removeTile
-
setTile
-
setTeam
-
buildDestroyed
public static void buildDestroyed(mindustry.gen.Building build) -
buildHealthUpdate
-