Package mindustry.world
Class Block
java.lang.Object
mindustry.ctype.Content
mindustry.ctype.MappableContent
mindustry.ctype.UnlockableContent
mindustry.world.Block
- All Implemented Interfaces:
Comparable<Content>
,Senseable
- Direct Known Subclasses:
Accelerator
,BaseShield
,BaseTurret
,BeamDrill
,CanvasBlock
,Cliff
,ConstructBlock
,Conveyor
,DirectionalForceProjector
,DirectionalUnloader
,DirectionBridge
,Drill
,DroneCenter
,Duct
,DuctJunction
,DuctRouter
,Floor
,ForceProjector
,GenericCrafter
,HeatConductor
,Incinerator
,ItemBridge
,ItemIncinerator
,ItemSource
,ItemVoid
,Junction
,LandingPad
,LaunchPad
,LegacyBlock
,LightBlock
,LiquidBlock
,LiquidSource
,LiquidVoid
,LogicBlock
,LogicDisplay
,MassDriver
,MemoryBlock
,MendProjector
,MessageBlock
,OverdriveProjector
,OverflowDuct
,OverflowGate
,PayloadBlock
,PayloadConveyor
,PowerBlock
,PowerDiode
,Prop
,Radar
,RegenProjector
,RemoveWall
,RepairTower
,RepairTurret
,Router
,Separator
,ShockMine
,ShockwaveTower
,Sorter
,StackConveyor
,StorageBlock
,SwitchBlock
,TallBlock
,TreeBlock
,UnitCargoLoader
,UnitCargoUnloadPoint
,Unloader
,Wall
,WallCrafter
-
Nested Class Summary
Nested classes/interfaces inherited from class mindustry.ctype.Content
Content.ModContentInfo
-
Field Summary
FieldsModifier and TypeFieldDescriptionboolean
whether this block absorbs laser attacks.boolean
Visual flag use for blending of certain transportation blocks.boolean
If true, payloads will attempt to move into this block.boolean
If true, this block can input payloads; affects unit payload enter behavior.float
How reflective this block is.boolean
If true, the building inventory can be shown with the config.boolean
If true, this derelict block can be repair by clicking it.boolean
If false, diagonal placement (ctrl) for this block is not allowed.boolean
Whether to allow rectangular placement, as opposed to a line.boolean
whether units can resupply by taking items from this blockboolean
whether this block can be replaced in all casesboolean
if true, this block updates in payloads in units regardless of the experimental game rulearc.audio.Sound
The sound that this block makes while idle.float
Idle sound base volume.float
damage absorption, similar to unit armorboolean
If true, this block attacks and is considered a turret in the indexer.Array of affinities to certain things.boolean
whether to automatically reset enabled status after a logic block has not interacted for a while.Map of bars by name.float
base block explosivenessfloat
base value for screen shake upon destructionboolean
whether you can break this with rightclickEffect for breaking the block.boolean
Should the sound made when this block is deconstructed change in pitch.arc.audio.Sound
Sound made when this block is deconstructed.float
Multiplier for speed of building this block.float
Time to build this block in ticks.arc.func.Prov<mindustry.gen.Building>
Building that is created for this block.Whether this block is visible and can currently be built.Cache layer.boolean
Whether the overdrive core has any effect on this block.boolean
if true, this block can be picked up in payloadsCategory in place menu.boolean
if true, double-tapping this configurable block clears configuration.float
Clipping size of this block.boolean
If true, this building can be selected like a unit when commanding.boolean
If true, this block can conduct power like a cable.boolean
Whether the block can be tapped and selected to configure.arc.struct.ObjectMap<Class<?>,
arc.func.Cons2> Configuration handlers by type.boolean
If false, power nodes cannot connect to this block.The single power consumer, if applicable.protected arc.struct.Seq<Consume>
List for building up consumption before init().Consume[]
Array of consumers used by this block.boolean
Used by certain power blocks (nodes) to flag as non-consuming of power.boolean
Whether this block consumes touchDown events when tapped.boolean
Whether this block uses conveyor-type placement mode.boolean
whether to allow copying the config through middle clickboolean
whether rubble is created when this block is destroyedfloat
Multiplier of damage dealt to this block by tanks.boolean
If true, a custom shadow (name-shadow) is drawn under this block.arc.graphics.g2d.TextureRegion
boolean
if false, only incinerable liquids are dropped when deconstructing; otherwise, all liquids are dropped.float
Build completion at which deconstruction finishes.bullet that this block spawns when destroyedboolean
if true, destroyBullet is spawned on the block's team instead of Derelict teamEffect for destroying the block.float
Range of destroy sound.float
Range of destroy sound.arc.audio.Sound
Sounds made when this block is destroyed.boolean
whether this block has health and can be destroyedboolean
whether to display flow rateboolean
whether to draw a rotation arrow - this does not apply to lines of blocksboolean
whether cracks are drawn when this block is damagedboolean
whether to draw disabled statusboolean
Whether to draw the glow of the liquid for this block, if it has one.boolean
whether to draw the team corner by defaultint
How often to try dumping items in ticks, e.g.arc.graphics.g2d.TextureRegion
protected arc.graphics.g2d.TextureRegion[]
boolean
If true, drawLight() will be called for this block.boolean
if false, the status is never drawnint
The environment flags that this block *cannot* function in.int
The environment flags that this block can function in.int
Environmental flags that are *all* required for this block to function.float
scaling of explosiveness based on items/liquidsboolean
Special flag; if false, floor will be drawn under this block even if it is cached.arc.struct.EnumSet<BlockFlag>
List of block flags.float
scaling of explosion flammability based on items/liquidsboolean
whether this block can be placed on edges of liquids.int
How much fog this block uncovers, in tiles.boolean
If true, this block can be covered by darkness / fog even if synthetic.If set, all blocks will be forced to be this team.protected arc.graphics.g2d.TextureRegion[]
The block group.boolean
Whether this block has a minimap color.boolean
Set to true if this block has any consumers in its array.boolean
If true, buildings have an ItemModule.boolean
If true, buildings have a LiquidModule.boolean
If true, buildings have a PowerModule.boolean
Whether this block has a shadow under it.int
building health; -1 to use scaledHealthboolean
If true, this block can be placed even in "dark" areas.boolean
If true, this block does not have pointConfig with a transform called on map resize.boolean
whether this block is visible in the editorboolean
If true, this block constructs immediately.boolean
If true, this block deconstructs immediately.boolean
Whether this block has instant transfer.boolean
whether this block has insulating properties.boolean
if true, schematic flips with this block are inverted.boolean
if true, this block acts a duct and will connect to armored ducts from the side.int
maximum items this block can carry (usually, this is per-type of item)item that drops from this block, used for drillsboolean[]
Consumption filters.the last configuration value applied to this block.float
Clipping size for lights only.arc.graphics.Color
Environmental passive light color.liquid used for lightingfloat
Radius of the light emitted by this block.float
maximum total liquids this block can carry if hasLiquids = trueboolean[]
Consumption filters.float
higher numbers increase liquid output speed; TODO remove and replace with better liquids systemboolean
if rotate = false and this is true, rotation will be locked at 0 when placing (default); advanced use onlyboolean
If true, this block can be configured by logic.arc.graphics.Color
The color of this block when displayed on the minimap or map preview.Consume[]
Array of consumers used by this block.boolean
if true, this block does not accept input from the sides (used for armored conveyors)boolean
if true, the block stops updating when disabledfloat
multiblock offsetConsume[]
Array of consumers used by this block.arc.graphics.Color
Outlined icon color.int
Which of the icon regions gets the outline added.boolean
Whether any icon region has an outline added.int
Outline icon radius.boolean
If true, this block outputs to its facing direction, when applicable.boolean
Flag for determining whether this block outputs liquid somewhere; used for connections.boolean
If true, this block can output payloads; affects blending.boolean
If true, this block is a generator that can produce power.boolean
whether this block can be placed on any liquids, anywhereboolean
whether this floor can be placed on.boolean
whether this block can be placed directly by the player via PlacementFragmentEffect for placing the block.float
When placeRangeCheck is enabled, this is the range checked for enemy blocks.boolean
Should the sound made when this block is built change in pitch.arc.audio.Sound
Sound made when this block is built.boolean
if true, this block cannot be mined by players.float
Targeting priority of this block, as seen by enemies.boolean
if true, this logic-related block can only be used with privileged processors (or is one itself)boolean
Whether you can rotate this block after it is placed.boolean
whether to add this block to brokenblocksarc.graphics.g2d.TextureRegion
int
Regions indexes from icons() that are rotated.int
Regions indexes from icons() that are rotated.boolean
if false, this block can never be replaced.Cost of constructing this block.boolean
whether this block can only be placed on waterOverride for research cost.float
Multiplier for cost of research in tech tree.arc.struct.ObjectFloatMap<Item>
Cost multipliers per-item.boolean
whether this is rotatableboolean
if rotate is true and this is false, the region won't rotate when drawingboolean
whether to save the last config and apply it to newly placed blocksboolean
for static blocks only: if true, tile data() is saved in world data.float
Health per square tile that this block occupies; essentially, this is multiplied by size * size.int
Build queue priority in schematics.int
Defines how large selection menus, such as that of sorters, should be.int
Defines how large selection menus, such as that of sorters, should be.float
Scroll position for certain blocks.boolean
If true, all item capacities of this block are separate instead of pooled as one number.int
multiblock sizeint
offset for iteration (internal use only)boolean
whether this is solidboolean
whether this block CAN be solid.boolean
whether the sprite is a full square.Class<?>
Main subclass.boolean
If true, this block is mending-related and can be suppressed with special units/missiles.boolean
Whether to swap the diagonal placement modes.boolean
Whether to periodically sync this block across the network.boolean
Whether units target this block.boolean
if true, this counts as a non-solid block to this team.arc.graphics.g2d.TextureRegion
arc.graphics.g2d.TextureRegion[]
protected static final arc.struct.Seq<mindustry.gen.Building>
protected static final arc.struct.Seq<Tile>
protected final int
Dump timer ID.int
Max of timers used.boolean
if true, this block cannot be hit by bullets unless explicitly targeted.int
How much this block affects the unit cap by.boolean
if true, this block will be broken by certain units stepping/moving over itboolean
whether unloaders work on this blockboolean
whether this block has a tile entity that updatesConsume[]
Array of consumers used by this block.boolean
if true, this block updates when it's a payload in a unit.boolean
Whether to use this block's color in the minimap.arc.graphics.g2d.TextureRegion[]
int
number of different variant regions to usearc.graphics.g2d.TextureRegion[]
Fields inherited from class mindustry.ctype.UnlockableContent
allDatabaseTabs, alwaysUnlocked, databaseTabs, description, details, fullIcon, fullOverride, generateIcons, hideDatabase, hideDetails, inlineDescription, localizedName, selectionSize, shownPlanets, stats, techNode, techNodes, uiIcon, unlocked
Fields inherited from class mindustry.ctype.MappableContent
name
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T extends mindustry.gen.Building>
void<T extends mindustry.gen.Building>
voidaddLiquidBar
(arc.func.Func<T, Liquid> current) Adds a liquid bar that dynamically displays a liquid type.void
addLiquidBar
(Liquid liq) asFloor()
void
beforePlaceBegan
(Tile tile, Block previous) Called right before building of this block begins.arc.math.geom.Rect
bounds
(int x, int y, arc.math.geom.Rect rect) boolean
boolean
boolean
canPlaceOn
(Tile tile, Team team, int rotation) boolean
canReplace
(Block other) void
changePlacementPath
(arc.struct.Seq<arc.math.geom.Point2> points, int rotation) Mutates the given list of points used during line placement.void
changePlacementPath
(arc.struct.Seq<arc.math.geom.Point2> points, int rotation, boolean diagonalOn) Mutates the given list of points used during line placement.boolean
checkForceDark
(Tile tile) <T,
E extends mindustry.gen.Building>
voidListen for a config by class type.<E extends mindustry.gen.Building>
voidconfigClear
(arc.func.Cons<E> cons) Configure when a null value is passed.boolean
<T extends Consume>
Tconsume
(T consume) consumeCoolant
(float amount) consumeCoolant
(float amount, boolean allowLiquid, boolean allowGas) consumeItem
(Item item) consumeItem
(Item item, int amount) consumeItems
(ItemStack... items) consumeLiquid
(Liquid liquid, float amount) consumeLiquids
(LiquidStack... stacks) consumePower
(float powerPerTick) Creates a consumer which directly uses power without buffering it.consumePowerBuffered
(float powerCapacity) Creates a consumer which stores power.<T extends mindustry.gen.Building>
ConsumePowerconsumePowerCond
(float usage, arc.func.Boolf<T> cons) Creates a consumer which only consumes power when the condition is met.<T extends mindustry.gen.Building>
ConsumePowerconsumePowerDynamic
(float displayed, arc.func.Floatf<T> usage) Creates a consumer that consumes a dynamic amount of power.<T extends mindustry.gen.Building>
ConsumePowerconsumePowerDynamic
(arc.func.Floatf<T> usage) Creates a consumer that consumes a dynamic amount of power.boolean
consumesItem
(Item item) boolean
consumesLiquid
(Liquid liq) void
createIcons
(MultiPacker packer) Generate any special icons for this content.boolean
displayShadow
(Tile tile) void
void
drawDefaultPlanRegion
(BuildPlan plan, arc.util.Eachable<BuildPlan> list) this is a different method so subclasses can call it even after overriding the basevoid
drawEnvironmentLight
(Tile tile) void
drawOverlay
(float x, float y, int rotation) Drawn when placing and when hovering over.void
drawPlace
(int x, int y, int rotation, boolean valid) Drawn when you are placing a block.float
drawPlaceText
(String text, int x, int y, boolean valid) void
void
void
drawPlanConfig
(BuildPlan plan, arc.util.Eachable<BuildPlan> list) void
drawPlanConfigCenter
(BuildPlan plan, Object content, String region) void
drawPlanConfigCenter
(BuildPlan plan, Object content, String region, boolean cross) void
drawPlanConfigTop
(BuildPlan plan, arc.util.Eachable<BuildPlan> list) void
drawPlanRegion
(BuildPlan plan, arc.util.Eachable<BuildPlan> list) void
drawPotentialLinks
(int x, int y) void
drawShadow
(Tile tile) void
drawSideRegion
(arc.graphics.g2d.TextureRegion region, float x, float y, int rotation) Draws a region to overlay a specific side of this block.arc.graphics.g2d.TextureRegion
Never use outside of the editor!arc.graphics.g2d.TextureRegion[]
Never use outside of the editor!boolean
<T extends Consume>
TfindConsumer
(arc.func.Boolf<Consume> filter) void
flipRotation
(BuildPlan req, boolean x) Returns the type name of this piece of content.void
getDependencies
(arc.func.Cons<UnlockableContent> cons) Iterates through any implicit dependencies of this content.arc.graphics.g2d.TextureRegion
getDisplayIcon
(Tile tile) getDisplayName
(Tile tile) arc.math.geom.Point2[]
getEdges()
arc.graphics.g2d.TextureRegion[]
arc.math.geom.Point2[]
void
getPlanConfigs
(arc.struct.Seq<UnlockableContent> options) Fills the specified array with the list of configuration options this block has.arc.graphics.g2d.TextureRegion
getPlanRegion
(BuildPlan plan, arc.util.Eachable<BuildPlan> list) void
getRegionsToOutline
(arc.struct.Seq<arc.graphics.g2d.TextureRegion> out) getReplacement
(BuildPlan req, arc.struct.Seq<BuildPlan> plans) void
handlePlacementLine
(arc.struct.Seq<BuildPlan> plans) Mutates the given list of plans used during line placement.boolean
boolean
hasConsumer
(Consume cons) protected arc.graphics.g2d.TextureRegion[]
icons()
void
init()
Called after all blocks are created.protected void
boolean
boolean
isAir()
boolean
isFloor()
boolean
isHidden()
Whether this content is always hidden in the content database dialog.boolean
boolean
boolean
boolean
isStatic()
boolean
void
iterateTaken
(int x, int y, arc.func.Intc2 placer) Iterate through ever grid position taken up by this block.listBars()
void
load()
Called after all content is created, only on non-headless versions.boolean
arc.graphics.g2d.TextureRegion[]
int
minimapColor
(Tile tile) void
nearbySide
(int x, int y, int rotation, int index, arc.math.geom.Point2 out) sets to the index-th side outside of this block, using the given rotation.final mindustry.gen.Building
void
Called when a new build plan is created in the player's queue.boolean
float
percentSolid
(int x, int y) void
placeBegan
(Tile tile, Block previous) Called when building of this block begins.void
placeBegan
(Tile tile, Block previous, mindustry.gen.Unit builder) Called when building of this block begins.void
placeEnded
(Tile tile, mindustry.gen.Unit builder) Called when building of this block ends.int
planRotation
(int rot) pointConfig
(Object config, arc.func.Cons<arc.math.geom.Point2> transformer) Transforms the internal position of this config using the specified function, and return the result.void
postInit()
Called after init().void
void
removeConsumer
(Consume cons) void
removeConsumers
(arc.func.Boolf<Consume> b) void
requirements
(Category cat, ItemStack[] stacks) void
requirements
(Category cat, ItemStack[] stacks, boolean unlocked) void
requirements
(Category cat, BuildVisibility visible, ItemStack[] stacks) Sets up requirements.void
boolean
rotatedOutput
(int x, int y) boolean
rotatedOutput
(int fromX, int fromY, Tile destination) double
double
senseObject
(LAccess sensor) void
setBars()
void
setStats()
Initializes stats on demand.void
setupRequirements
(Category cat, ItemStack[] stacks) void
setupRequirements
(Category cat, BuildVisibility visible, ItemStack[] stacks) float
sumAttribute
(Attribute attr, int x, int y) boolean
supportsEnv
(int env) boolean
void
updateClipRadius
(float radiusInWorldUnits) arc.graphics.g2d.TextureRegion[]
Methods inherited from class mindustry.ctype.UnlockableContent
checkStats, clearUnlock, displayDescription, displayExtra, emoji, emojiChar, getLogicId, hasEmoji, isOnPlanet, loadIcon, locked, makeOutline, makeOutline, makeOutline, onUnlock, quietUnlock, showUnlock, unlock, unlocked, unlockedHost, unlockedNow, unlockedNowHost
Methods inherited from class mindustry.ctype.MappableContent
toString
Methods inherited from class mindustry.ctype.Content
compareTo, hasErrored, isModded, isVanilla
-
Field Details
-
hasItems
public boolean hasItemsIf true, buildings have an ItemModule. -
hasLiquids
public boolean hasLiquidsIf true, buildings have a LiquidModule. -
hasPower
public boolean hasPowerIf true, buildings have a PowerModule. -
outputsLiquid
public boolean outputsLiquidFlag for determining whether this block outputs liquid somewhere; used for connections. -
consumesPower
public boolean consumesPowerUsed by certain power blocks (nodes) to flag as non-consuming of power. True by default, even if this block has no power. -
outputsPower
public boolean outputsPowerIf true, this block is a generator that can produce power. -
connectedPower
public boolean connectedPowerIf false, power nodes cannot connect to this block. -
conductivePower
public boolean conductivePowerIf true, this block can conduct power like a cable. -
outputsPayload
public boolean outputsPayloadIf true, this block can output payloads; affects blending. -
acceptsUnitPayloads
public boolean acceptsUnitPayloadsIf true, this block can input payloads; affects unit payload enter behavior. -
acceptsPayload
public boolean acceptsPayloadIf true, payloads will attempt to move into this block. -
acceptsItems
public boolean acceptsItemsVisual flag use for blending of certain transportation blocks. -
separateItemCapacity
public boolean separateItemCapacityIf true, all item capacities of this block are separate instead of pooled as one number. -
itemCapacity
public int itemCapacitymaximum items this block can carry (usually, this is per-type of item) -
liquidCapacity
public float liquidCapacitymaximum total liquids this block can carry if hasLiquids = true -
liquidPressure
public float liquidPressurehigher numbers increase liquid output speed; TODO remove and replace with better liquids system -
outputFacing
public boolean outputFacingIf true, this block outputs to its facing direction, when applicable. Used for blending calculations. -
noSideBlend
public boolean noSideBlendif true, this block does not accept input from the sides (used for armored conveyors) -
displayFlow
public boolean displayFlowwhether to display flow rate -
inEditor
public boolean inEditorwhether this block is visible in the editor -
lastConfig
the last configuration value applied to this block. -
saveConfig
public boolean saveConfigwhether to save the last config and apply it to newly placed blocks -
copyConfig
public boolean copyConfigwhether to allow copying the config through middle click -
clearOnDoubleTap
public boolean clearOnDoubleTapif true, double-tapping this configurable block clears configuration. -
update
public boolean updatewhether this block has a tile entity that updates -
destructible
public boolean destructiblewhether this block has health and can be destroyed -
unloadable
public boolean unloadablewhether unloaders work on this block -
isDuct
public boolean isDuctif true, this block acts a duct and will connect to armored ducts from the side. -
allowResupply
public boolean allowResupplywhether units can resupply by taking items from this block -
solid
public boolean solidwhether this is solid -
solidifes
public boolean solidifeswhether this block CAN be solid. -
teamPassable
public boolean teamPassableif true, this counts as a non-solid block to this team. -
underBullets
public boolean underBulletsif true, this block cannot be hit by bullets unless explicitly targeted. -
rotate
public boolean rotatewhether this is rotatable -
rotateDraw
public boolean rotateDrawif rotate is true and this is false, the region won't rotate when drawing -
lockRotation
public boolean lockRotationif rotate = false and this is true, rotation will be locked at 0 when placing (default); advanced use only -
invertFlip
public boolean invertFlipif true, schematic flips with this block are inverted. -
variants
public int variantsnumber of different variant regions to use -
drawArrow
public boolean drawArrowwhether to draw a rotation arrow - this does not apply to lines of blocks -
drawTeamOverlay
public boolean drawTeamOverlaywhether to draw the team corner by default -
saveData
public boolean saveDatafor static blocks only: if true, tile data() is saved in world data. -
breakable
public boolean breakablewhether you can break this with rightclick -
unitMoveBreakable
public boolean unitMoveBreakableif true, this block will be broken by certain units stepping/moving over it -
rebuildable
public boolean rebuildablewhether to add this block to brokenblocks -
privileged
public boolean privilegedif true, this logic-related block can only be used with privileged processors (or is one itself) -
requiresWater
public boolean requiresWaterwhether this block can only be placed on water -
placeableLiquid
public boolean placeableLiquidwhether this block can be placed on any liquids, anywhere -
placeablePlayer
public boolean placeablePlayerwhether this block can be placed directly by the player via PlacementFragment -
placeableOn
public boolean placeableOnwhether this floor can be placed on. -
insulated
public boolean insulatedwhether this block has insulating properties. -
squareSprite
public boolean squareSpritewhether the sprite is a full square. -
absorbLasers
public boolean absorbLaserswhether this block absorbs laser attacks. -
enableDrawStatus
public boolean enableDrawStatusif false, the status is never drawn -
drawDisabled
public boolean drawDisabledwhether to draw disabled status -
autoResetEnabled
public boolean autoResetEnabledwhether to automatically reset enabled status after a logic block has not interacted for a while. -
noUpdateDisabled
public boolean noUpdateDisabledif true, the block stops updating when disabled -
updateInUnits
public boolean updateInUnitsif true, this block updates when it's a payload in a unit. -
alwaysUpdateInUnits
public boolean alwaysUpdateInUnitsif true, this block updates in payloads in units regardless of the experimental game rule -
canPickup
public boolean canPickupif true, this block can be picked up in payloads -
deconstructDropAllLiquid
public boolean deconstructDropAllLiquidif false, only incinerable liquids are dropped when deconstructing; otherwise, all liquids are dropped. -
useColor
public boolean useColorWhether to use this block's color in the minimap. Only used for overlays. -
itemDrop
item that drops from this block, used for drills -
playerUnmineable
public boolean playerUnmineableif true, this block cannot be mined by players. useful for annoying things like sand. -
attributes
Array of affinities to certain things. -
scaledHealth
public float scaledHealthHealth per square tile that this block occupies; essentially, this is multiplied by size * size. Overridden if health is > 0. If <0, the default is 40. -
health
public int healthbuilding health; -1 to use scaledHealth -
armor
public float armordamage absorption, similar to unit armor -
baseExplosiveness
public float baseExplosivenessbase block explosiveness -
explosivenessScale
public float explosivenessScalescaling of explosiveness based on items/liquids -
flammabilityScale
public float flammabilityScalescaling of explosion flammability based on items/liquids -
baseShake
public float baseShakebase value for screen shake upon destruction -
destroyBullet
bullet that this block spawns when destroyed -
destroyBulletSameTeam
public boolean destroyBulletSameTeamif true, destroyBullet is spawned on the block's team instead of Derelict team -
lightLiquid
liquid used for lighting -
drawCracks
public boolean drawCrackswhether cracks are drawn when this block is damaged -
createRubble
public boolean createRubblewhether rubble is created when this block is destroyed -
floating
public boolean floatingwhether this block can be placed on edges of liquids. -
size
public int sizemultiblock size -
offset
public float offsetmultiblock offset -
sizeOffset
public int sizeOffsetoffset for iteration (internal use only) -
clipSize
public float clipSizeClipping size of this block. Should be as large as the block will draw. -
lightClipSize
public float lightClipSizeClipping size for lights only. -
placeOverlapRange
public float placeOverlapRangeWhen placeRangeCheck is enabled, this is the range checked for enemy blocks. -
crushDamageMultiplier
public float crushDamageMultiplierMultiplier of damage dealt to this block by tanks. Does not apply to crawlers. -
timers
public int timersMax of timers used. -
cacheLayer
Cache layer. Only used for 'cached' rendering. -
fillsTile
public boolean fillsTileSpecial flag; if false, floor will be drawn under this block even if it is cached. -
forceDark
public boolean forceDarkIf true, this block can be covered by darkness / fog even if synthetic. -
alwaysReplace
public boolean alwaysReplacewhether this block can be replaced in all cases -
replaceable
public boolean replaceableif false, this block can never be replaced. -
group
The block group. UnlesscanReplace(mindustry.world.Block)
is overridden, blocks in the same group can replace each other. -
flags
List of block flags. Used for AI indexing. -
priority
public float priorityTargeting priority of this block, as seen by enemies. -
unitCapModifier
public int unitCapModifierHow much this block affects the unit cap by. The block flags must contain unitModifier in order for this to work. -
configurable
public boolean configurableWhether the block can be tapped and selected to configure. -
ignoreResizeConfig
public boolean ignoreResizeConfigIf true, this block does not have pointConfig with a transform called on map resize. -
commandable
public boolean commandableIf true, this building can be selected like a unit when commanding. -
allowConfigInventory
public boolean allowConfigInventoryIf true, the building inventory can be shown with the config. -
selectionRows
public int selectionRowsDefines how large selection menus, such as that of sorters, should be. -
selectionColumns
public int selectionColumnsDefines how large selection menus, such as that of sorters, should be. -
logicConfigurable
public boolean logicConfigurableIf true, this block can be configured by logic. -
consumesTap
public boolean consumesTapWhether this block consumes touchDown events when tapped. -
drawLiquidLight
public boolean drawLiquidLightWhether to draw the glow of the liquid for this block, if it has one. -
envRequired
public int envRequiredEnvironmental flags that are *all* required for this block to function. 0 = any environment -
envEnabled
public int envEnabledThe environment flags that this block can function in. If the env matches any of these, it will be enabled. -
envDisabled
public int envDisabledThe environment flags that this block *cannot* function in. If the env matches any of these, it will be *disabled*. -
sync
public boolean syncWhether to periodically sync this block across the network. -
conveyorPlacement
public boolean conveyorPlacementWhether this block uses conveyor-type placement mode. -
allowDiagonal
public boolean allowDiagonalIf false, diagonal placement (ctrl) for this block is not allowed. -
swapDiagonalPlacement
public boolean swapDiagonalPlacementWhether to swap the diagonal placement modes. -
allowRectanglePlacement
public boolean allowRectanglePlacementWhether to allow rectangular placement, as opposed to a line. -
schematicPriority
public int schematicPriorityBuild queue priority in schematics. -
mapColor
public arc.graphics.Color mapColorThe color of this block when displayed on the minimap or map preview. Do not set manually! This is overridden when loading for most blocks. -
hasColor
public boolean hasColorWhether this block has a minimap color. -
targetable
public boolean targetableWhether units target this block. -
attacks
public boolean attacksIf true, this block attacks and is considered a turret in the indexer. Building must implement Ranged. -
suppressable
public boolean suppressableIf true, this block is mending-related and can be suppressed with special units/missiles. -
canOverdrive
public boolean canOverdriveWhether the overdrive core has any effect on this block. -
outlineColor
public arc.graphics.Color outlineColorOutlined icon color. -
outlineIcon
public boolean outlineIconWhether any icon region has an outline added. -
outlineRadius
public int outlineRadiusOutline icon radius. -
outlinedIcon
public int outlinedIconWhich of the icon regions gets the outline added. Uses last icon if <= 0. -
hasShadow
public boolean hasShadowWhether this block has a shadow under it. -
customShadow
public boolean customShadowIf true, a custom shadow (name-shadow) is drawn under this block. -
placePitchChange
public boolean placePitchChangeShould the sound made when this block is built change in pitch. -
breakPitchChange
public boolean breakPitchChangeShould the sound made when this block is deconstructed change in pitch. -
placeSound
public arc.audio.Sound placeSoundSound made when this block is built. -
breakSound
public arc.audio.Sound breakSoundSound made when this block is deconstructed. -
destroySound
public arc.audio.Sound destroySoundSounds made when this block is destroyed. -
destroyPitchMin
public float destroyPitchMinRange of destroy sound. -
destroyPitchMax
public float destroyPitchMaxRange of destroy sound. -
albedo
public float albedoHow reflective this block is. -
lightColor
public arc.graphics.Color lightColorEnvironmental passive light color. -
emitLight
public boolean emitLightIf true, drawLight() will be called for this block. -
lightRadius
public float lightRadiusRadius of the light emitted by this block. -
fogRadius
public int fogRadiusHow much fog this block uncovers, in tiles. Cannot be dynamic. <= 0 to disable. -
ambientSound
public arc.audio.Sound ambientSoundThe sound that this block makes while idle. Uses one sound loop for all blocks. -
ambientSoundVolume
public float ambientSoundVolumeIdle sound base volume. -
requirements
Cost of constructing this block. -
category
Category in place menu. -
buildTime
public float buildTimeTime to build this block in ticks. If this value is <0, it is calculated dynamically. -
buildVisibility
Whether this block is visible and can currently be built. -
buildCostMultiplier
public float buildCostMultiplierMultiplier for speed of building this block. -
deconstructThreshold
public float deconstructThresholdBuild completion at which deconstruction finishes. -
instantDeconstruct
public boolean instantDeconstructIf true, this block deconstructs immediately. Instant deconstruction implies no resource refund. -
instantBuild
public boolean instantBuildIf true, this block constructs immediately. This implies no resource requirement, and ignores configs - do not use, this is for performance only! -
ignoreBuildDarkness
public boolean ignoreBuildDarknessIf true, this block can be placed even in "dark" areas. Only used for editor static walls. -
placeEffect
Effect for placing the block. Passes size as rotation. -
breakEffect
Effect for breaking the block. Passes size as rotation. -
destroyEffect
Effect for destroying the block. -
researchCostMultiplier
public float researchCostMultiplierMultiplier for cost of research in tech tree. -
researchCostMultipliers
Cost multipliers per-item. -
researchCost
Override for research cost. Uses multipliers above and building requirements if not set. -
forceTeam
If set, all blocks will be forced to be this team. -
instantTransfer
public boolean instantTransferWhether this block has instant transfer. -
quickRotate
public boolean quickRotateWhether you can rotate this block after it is placed. -
allowDerelictRepair
public boolean allowDerelictRepairIf true, this derelict block can be repair by clicking it. -
subclass
Main subclass. Non-anonymous. -
selectScroll
public float selectScrollScroll position for certain blocks. -
buildType
public arc.func.Prov<mindustry.gen.Building> buildTypeBuilding that is created for this block. Initialized in init() via reflection. Set manually if modded. -
configurations
Configuration handlers by type. -
itemFilter
public boolean[] itemFilterConsumption filters. -
liquidFilter
public boolean[] liquidFilterConsumption filters. -
consumers
Array of consumers used by this block. Only populated after init(). -
optionalConsumers
Array of consumers used by this block. Only populated after init(). -
nonOptionalConsumers
Array of consumers used by this block. Only populated after init(). -
updateConsumers
Array of consumers used by this block. Only populated after init(). -
hasConsumers
public boolean hasConsumersSet to true if this block has any consumers in its array. -
consPower
The single power consumer, if applicable. -
barMap
Map of bars by name. -
consumeBuilder
List for building up consumption before init(). -
generatedIcons
protected arc.graphics.g2d.TextureRegion[] generatedIcons -
editorVariantRegions
protected arc.graphics.g2d.TextureRegion[] editorVariantRegions -
regionRotated1
public int regionRotated1Regions indexes from icons() that are rotated. If either of these is not -1, other regions won't be rotated in ConstructBlocks. -
regionRotated2
public int regionRotated2Regions indexes from icons() that are rotated. If either of these is not -1, other regions won't be rotated in ConstructBlocks. -
region
public arc.graphics.g2d.TextureRegion region -
editorIcon
public arc.graphics.g2d.TextureRegion editorIcon -
customShadowRegion
public arc.graphics.g2d.TextureRegion customShadowRegion -
teamRegion
public arc.graphics.g2d.TextureRegion teamRegion -
teamRegions
public arc.graphics.g2d.TextureRegion[] teamRegions -
variantRegions
public arc.graphics.g2d.TextureRegion[] variantRegions -
variantShadowRegions
public arc.graphics.g2d.TextureRegion[] variantShadowRegions -
tempTiles
-
tempBuilds
protected static final arc.struct.Seq<mindustry.gen.Building> tempBuilds -
timerDump
protected final int timerDumpDump timer ID. -
dumpTime
public int dumpTimeHow often to try dumping items in ticks, e.g. 5 = 12 times/sec
-
-
Constructor Details
-
Block
-
-
Method Details
-
drawBase
-
drawShadow
-
percentSolid
public float percentSolid(int x, int y) -
drawEnvironmentLight
-
drawPlace
public void drawPlace(int x, int y, int rotation, boolean valid) Drawn when you are placing a block. -
drawSideRegion
public void drawSideRegion(arc.graphics.g2d.TextureRegion region, float x, float y, int rotation) Draws a region to overlay a specific side of this block. This method makes sure it is placed at the edge of the side. -
drawPotentialLinks
public void drawPotentialLinks(int x, int y) -
drawPlaceText
-
drawOverlay
public void drawOverlay(float x, float y, int rotation) Drawn when placing and when hovering over. -
displayShadow
-
sumAttribute
-
getDisplayIcon
-
getDisplayName
-
minimapColor
- Returns:
- a custom minimap color for this or 0 to use default colors.
-
outputsItems
public boolean outputsItems() -
canPlaceOn
- Returns:
- whether this block can be placed on the specified tile.
-
canBreak
- Returns:
- whether this block can be broken on the specified tile.
-
rotatedOutput
public boolean rotatedOutput(int x, int y) -
rotatedOutput
-
synthetic
public boolean synthetic() -
checkForceDark
-
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 classUnlockableContent
-
addBar
-
removeBar
-
listBars
-
addLiquidBar
-
addLiquidBar
Adds a liquid bar that dynamically displays a liquid type. -
setBars
public void setBars() -
consumesItem
-
consumesLiquid
-
canReplace
-
getReplacement
- Returns:
- a possible replacement for this block when placed in a line by the player.
-
changePlacementPath
public void changePlacementPath(arc.struct.Seq<arc.math.geom.Point2> points, int rotation, boolean diagonalOn) Mutates the given list of points used during line placement. -
changePlacementPath
public void changePlacementPath(arc.struct.Seq<arc.math.geom.Point2> points, int rotation) Mutates the given list of points used during line placement. -
handlePlacementLine
Mutates the given list of plans used during line placement. -
configSenseable
public boolean configSenseable() -
nextConfig
-
onNewPlan
Called when a new build plan is created in the player's queue. Blocks can maintain a reference to this plan and add configs to it later. -
drawPlan
-
drawPlan
-
drawPlanRegion
-
drawDefaultPlanRegion
this is a different method so subclasses can call it even after overriding the base -
getPlanRegion
-
drawPlanConfig
-
drawPlanConfigCenter
-
drawPlanConfigCenter
-
drawPlanConfigTop
-
pointConfig
Transforms the internal position of this config using the specified function, and return the result. -
configClear
public <E extends mindustry.gen.Building> void configClear(arc.func.Cons<E> cons) Configure when a null value is passed. -
config
Listen for a config by class type. -
isAccessible
public boolean isAccessible() -
nearbySide
public void nearbySide(int x, int y, int rotation, int index, arc.math.geom.Point2 out) sets to the index-th side outside of this block, using the given rotation. -
getEdges
public arc.math.geom.Point2[] getEdges() -
getInsideEdges
public arc.math.geom.Point2[] getInsideEdges() -
iterateTaken
public void iterateTaken(int x, int y, arc.func.Intc2 placer) Iterate through ever grid position taken up by this block. -
editorIcon
public arc.graphics.g2d.TextureRegion editorIcon()Never use outside of the editor! -
editorVariantRegions
public arc.graphics.g2d.TextureRegion[] editorVariantRegions()Never use outside of the editor! -
makeIconRegions
public arc.graphics.g2d.TextureRegion[] makeIconRegions()- Returns:
- special icons to outline and save with an -outline variant. Vanilla only.
-
icons
protected arc.graphics.g2d.TextureRegion[] icons() -
getRegionsToOutline
public void getRegionsToOutline(arc.struct.Seq<arc.graphics.g2d.TextureRegion> out) -
getGeneratedIcons
public arc.graphics.g2d.TextureRegion[] getGeneratedIcons() -
resetGeneratedIcons
public void resetGeneratedIcons() -
variantRegions
public arc.graphics.g2d.TextureRegion[] variantRegions() -
hasBuilding
public boolean hasBuilding() -
newBuilding
public final mindustry.gen.Building newBuilding() -
updateClipRadius
public void updateClipRadius(float radiusInWorldUnits) -
bounds
public arc.math.geom.Rect bounds(int x, int y, arc.math.geom.Rect rect) -
isMultiblock
public boolean isMultiblock() -
isVisible
public boolean isVisible() -
isPlaceable
public boolean isPlaceable() -
supportsEnv
public boolean supportsEnv(int env) - Returns:
- whether this block supports a specific environment.
-
placeBegan
Called when building of this block begins. -
placeBegan
Called when building of this block begins. -
placeEnded
Called when building of this block ends. -
beforePlaceBegan
Called right before building of this block begins. -
isFloor
public boolean isFloor() -
isOverlay
public boolean isOverlay() -
asFloor
-
isAir
public boolean isAir() -
canBeBuilt
public boolean canBeBuilt() -
environmentBuildable
public boolean environmentBuildable() -
isStatic
public boolean isStatic() -
findConsumer
-
hasConsumer
-
removeConsumer
-
removeConsumers
-
consumeLiquid
-
consumeLiquids
-
consumePower
Creates a consumer which directly uses power without buffering it.- Parameters:
powerPerTick
- The amount of power which is required each tick for 100% efficiency.- Returns:
- the created consumer object.
-
consumePowerCond
public <T extends mindustry.gen.Building> ConsumePower consumePowerCond(float usage, arc.func.Boolf<T> cons) Creates a consumer which only consumes power when the condition is met. -
consumePowerDynamic
public <T extends mindustry.gen.Building> ConsumePower consumePowerDynamic(arc.func.Floatf<T> usage) Creates a consumer that consumes a dynamic amount of power. -
consumePowerDynamic
public <T extends mindustry.gen.Building> ConsumePower consumePowerDynamic(float displayed, arc.func.Floatf<T> usage) Creates a consumer that consumes a dynamic amount of power. -
consumePowerBuffered
Creates a consumer which stores power.- Parameters:
powerCapacity
- The maximum capacity in power units.
-
consumeItem
-
consumeItem
-
consumeItems
-
consumeCoolant
-
consumeCoolant
-
consume
-
setupRequirements
-
setupRequirements
-
requirements
-
requirements
-
requirements
Sets up requirements. Use only this method to set up requirements. -
initBuilding
protected void initBuilding() -
researchRequirements
- Overrides:
researchRequirements
in classUnlockableContent
- Returns:
- items needed to research this content
-
getDependencies
Description copied from class:UnlockableContent
Iterates through any implicit dependencies of this content. For blocks, this would be the items required to build it.- Overrides:
getDependencies
in classUnlockableContent
-
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 classContent
-
logicVisible
public boolean logicVisible()- Overrides:
logicVisible
in classUnlockableContent
-
postInit
public void postInit()Description copied from class:Content
Called after init().- Overrides:
postInit
in classUnlockableContent
-
init
public void init()Called after all blocks are created. -
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. -
isHidden
public boolean isHidden()Description copied from class:UnlockableContent
Whether this content is always hidden in the content database dialog.- Overrides:
isHidden
in classUnlockableContent
-
createIcons
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 classUnlockableContent
-
planRotation
public int planRotation(int rot) -
flipRotation
-
getPlanConfigs
Fills the specified array with the list of configuration options this block has. Only used for plans. -
sense
-
sense
-
senseObject
- Specified by:
senseObject
in interfaceSenseable
-