Class Floor

All Implemented Interfaces:
Comparable<Content>, Senseable
Direct Known Subclasses:
AirBlock, EmptyFloor, OverlayFloor, ShallowLiquid, SteamVent

public class Floor extends Block
  • Field Details

    • edge

      public String edge
      edge fallback, used mainly for ores
    • speedMultiplier

      public float speedMultiplier
      Multiplies unit velocity by this when walked on.
    • dragMultiplier

      public float dragMultiplier
      Multiplies unit drag by this when walked on.
    • damageTaken

      public float damageTaken
      Damage taken per tick on this tile.
    • drownTime

      public float drownTime
      How many ticks it takes to drown on this. 0 to disable.
    • walkEffect

      public Effect walkEffect
      Effect when walking on this floor.
    • walkSound

      public Sound walkSound
      Sound made when walking.
    • walkSoundVolume

      public float walkSoundVolume
      Volume of sound made when walking.
    • walkSoundPitchMin

      public float walkSoundPitchMin
      Volume of sound made when walking.
    • walkSoundPitchMax

      public float walkSoundPitchMax
      Volume of sound made when walking.
    • drownUpdateEffect

      public Effect drownUpdateEffect
      Effect displayed when drowning on this floor.
    • status

      public StatusEffect status
      Status effect applied when walking on.
    • statusDuration

      public float statusDuration
      Intensity of applied status effect.
    • liquidDrop

      @Nullable public Liquid liquidDrop
      liquids that drop from this block, used for pumps.
    • liquidMultiplier

      public float liquidMultiplier
      Multiplier for pumped liquids, used for deep water.
    • isLiquid

      public boolean isLiquid
      whether this block is liquid.
    • overlayAlpha

      public float overlayAlpha
      for liquid floors, this is the opacity of the overlay drawn on top.
    • supportsOverlay

      public boolean supportsOverlay
      whether this floor supports an overlay floor
    • shallow

      public boolean shallow
      shallow water flag used for generation
    • blendGroup

      public Block blendGroup
      Group of blocks that this block does not draw edges on.
    • oreDefault

      public boolean oreDefault
      Whether this ore generates in maps by default.
    • oreScale

      public float oreScale
      Ore generation params.
    • oreThreshold

      public float oreThreshold
      Ore generation params.
    • wall

      public Block wall
      Wall variant of this block. May be Blocks.air if not found.
    • decoration

      public Block decoration
      Decoration block. Usually a rock. May be air.
    • canShadow

      public boolean canShadow
      Whether units can draw shadows over this.
    • needsSurface

      public boolean needsSurface
      Whether this overlay needs a surface to be on. False for floating blocks, like spawns.
    • allowCorePlacement

      public boolean allowCorePlacement
      If true, cores can be placed on this floor.
    • wallOre

      public boolean wallOre
      If true, this ore is allowed on walls.
    • blendId

      public int blendId
      Actual ID used for blend groups. Internal.
    • edges

      protected TextureRegion[][] edges
    • blenders

      protected Seq<Block> blenders
    • blended

      protected Bits blended
    • dirs

      protected int[] dirs
    • edgeRegion

      protected TextureRegion edgeRegion
  • Constructor Details

    • Floor

      public Floor(String name)
    • Floor

      public Floor(String name, int variants)
  • Method Details

    • load

      public void load()
      Description copied from class: Content
      Called after all content is created, only on non-headless versions. Use for loading regions or other image data.
      Overrides:
      load in class Block
    • init

      public void init()
      Description copied from class: Block
      Called after all blocks are created.
      Overrides:
      init in class Block
    • getDisplayIcon

      public TextureRegion getDisplayIcon(Tile tile)
      Overrides:
      getDisplayIcon in class Block
    • getDisplayName

      public String getDisplayName(Tile tile)
      Overrides:
      getDisplayName in class Block
    • createIcons

      public void createIcons(MultiPacker packer)
      Description copied from class: UnlockableContent
      Generate any special icons for this content. Called synchronously. No regions are loaded at this point; grab pixmaps from the packer.
      Overrides:
      createIcons in class Block
    • drawBase

      public void drawBase(Tile tile)
      Overrides:
      drawBase in class Block
    • drawOverlay

      public void drawOverlay(Tile tile)
    • icons

      public TextureRegion[] icons()
      Overrides:
      icons in class Block
    • updateRender

      public boolean updateRender(Tile tile)
      Returns:
      true if this floor should be updated in the render loop, e.g. for effects. Do NOT overuse this!
    • renderUpdate

      public void renderUpdate(Floor.UpdateRenderState tile)
    • hasSurface

      public boolean hasSurface()
      Returns:
      whether this floor has a valid surface on which to place things, e.g. scorch marks.
    • isDeep

      public boolean isDeep()
    • drawNonLayer

      public void drawNonLayer(Tile tile, CacheLayer layer)
    • drawEdges

      protected void drawEdges(Tile tile)
    • drawBlended

      protected void drawBlended(Tile tile, boolean checkId)
    • drawEdgesFlat

      protected void drawEdgesFlat(Tile tile, boolean sameLayer)
    • realBlendId

      public int realBlendId(Tile tile)
    • edges

      protected TextureRegion[][] edges()
    • doEdge

      protected boolean doEdge(Tile tile, Tile otherTile, Floor other)
      Returns:
      whether the edges from should be drawn onto this tile