Class Liquid

All Implemented Interfaces:
Comparable<Content>, Senseable
Direct Known Subclasses:
CellLiquid

public class Liquid extends UnlockableContent implements Senseable
A better name for this class would be "fluid", but it's too late for that.
  • Field Details

    • animationFrames

      public static final int animationFrames
      See Also:
    • animationScaleGas

      public static float animationScaleGas
    • animationScaleLiquid

      public static float animationScaleLiquid
    • rand

      protected static final Rand rand
    • gas

      public boolean gas
      If true, this fluid is treated as a gas (and does not create puddles)
    • color

      public Color color
      Color used in pipes and on the ground.
    • gasColor

      public Color gasColor
      Color of this liquid in gas form.
    • barColor

      @Nullable public Color barColor
      Color used in bars.
    • lightColor

      public Color lightColor
      Color used to draw lights. Note that the alpha channel is used to dictate brightness.
    • flammability

      public float flammability
      0-1, 0 is completely not flammable, anything above that may catch fire when exposed to heat, 0.5+ is very flammable.
    • temperature

      public float temperature
      temperature: 0.5 is 'room' temperature, 0 is very cold, 1 is molten hot
    • heatCapacity

      public float heatCapacity
      how much heat this liquid can store. 0.4=water (decent), anything lower is probably less dense and bad at cooling.
    • viscosity

      public float viscosity
      how thick this liquid is. 0.5=water (relatively viscous), 1 would be something like tar (very slow).
    • explosiveness

      public float explosiveness
      how prone to exploding this liquid is, when heated. 0 = nothing, 1 = nuke
    • blockReactive

      public boolean blockReactive
      whether this fluid reacts in blocks at all (e.g. slag with water)
    • coolant

      public boolean coolant
      if false, this liquid cannot be a coolant
    • moveThroughBlocks

      public boolean moveThroughBlocks
      if true, this liquid can move through blocks as a puddle.
    • incinerable

      public boolean incinerable
      if true, this liquid can be incinerated in the incinerator block.
    • effect

      public StatusEffect effect
      The associated status effect.
    • particleEffect

      public Effect particleEffect
      Effect shown in puddles.
    • particleSpacing

      public float particleSpacing
      Particle effect rate spacing in ticks.
    • boilPoint

      public float boilPoint
      Temperature at which this liquid vaporizes. This isn't just boiling.
    • capPuddles

      public boolean capPuddles
      If true, puddle size is capped.
    • vaporEffect

      public Effect vaporEffect
      Effect when this liquid vaporizes.
    • hidden

      public boolean hidden
      If true, this liquid is hidden in most UI.
    • canStayOn

      public ObjectSet<Liquid> canStayOn
      Liquids this puddle can stay on, e.g. oil on water.
  • Constructor Details

    • Liquid

      public Liquid(String name, Color color)
    • Liquid

      public Liquid(String name)
      For modding only.
  • Method Details

    • init

      public void init()
      Description copied from class: Content
      Called after all content and modules are created. Do not use to load regions or texture data!
      Overrides:
      init in class Content
    • isHidden

      public boolean isHidden()
      Description copied from class: UnlockableContent
      Whether this content is always hidden in the content database dialog.
      Overrides:
      isHidden in class UnlockableContent
    • getAnimationFrame

      public int getAnimationFrame()
    • willBoil

      public boolean willBoil()
      Returns:
      true if this liquid will boil in this global environment.
    • canExtinguish

      public boolean canExtinguish()
    • barColor

      public Color barColor()
    • drawPuddle

      public void drawPuddle(mindustry.gen.Puddle puddle)
      Draws a puddle of this liquid on the floor.
    • update

      public void update(mindustry.gen.Puddle puddle)
      Runs when puddles update.
    • react

      public float react(Liquid other, float amount, Tile tile, float x, float y)
    • setStats

      public void setStats()
      Description copied from class: UnlockableContent
      Initializes stats on demand. Should only be called once. Only called before something is displayed.
      Overrides:
      setStats in class UnlockableContent
    • sense

      public double sense(LAccess sensor)
      Specified by:
      sense in interface Senseable
    • senseObject

      public Object senseObject(LAccess sensor)
      Specified by:
      senseObject in interface Senseable
    • toString

      public String toString()
      Overrides:
      toString in class MappableContent
    • getContentType

      public ContentType getContentType()
      Description copied from class: Content
      Returns the type name of this piece of content. This should return the same value for all instances of this content type.
      Specified by:
      getContentType in class Content