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
,DuctRouter
,Floor
,ForceProjector
,GenericCrafter
,HeatConductor
,Incinerator
,ItemBridge
,ItemIncinerator
,ItemSource
,ItemVoid
,Junction
,LaunchPad
,LegacyBlock
,LightBlock
,LiquidBlock
,LiquidSource
,LiquidVoid
,LogicBlock
,LogicDisplay
,MassDriver
,MemoryBlock
,MendProjector
,MessageBlock
,OverdriveProjector
,OverflowDuct
,OverflowGate
,PayloadBlock
,PayloadConveyor
,PowerBlock
,PowerDiode
,Prop
,Radar
,RegenProjector
,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
Modifier 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.float
How reflective this block is.boolean
If true, the building inventory can be shown with the config.boolean
If false, diagonal placement (ctrl) for this block is not allowed.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 ruleThe 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.protected OrderedMap<String,
Func<mindustry.gen.Building, Bar>> Map of bars by name.float
base block explosivenessboolean
whether you can break this with rightclickEffect for breaking the block.boolean
Should the sound made when this block is deconstructed change in pitch.Sound made when this block is deconstructed.float
Time to build this block in ticks; do not modify directly!float
Multiplier for speed of building this block.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.Category 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.Configuration handlers by type.boolean
If false, power nodes cannot connect to this block.The single power consumer, if applicable.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.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.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 defaultprotected final int
How often to try dumping items in ticks, e.g.protected TextureRegion[]
boolean
Whether this environmental block passively emits light.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.boolean
Special flag; if false, floor will be drawn under this block even if it is cached.List of block flags.boolean
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.protected 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
whether this block is visible in the editorboolean
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.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.The sound that this block makes while active.float
Active sound base volume.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.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.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 brokenblocksint
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.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.protected static final Seq<mindustry.gen.Building>
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
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.int
number of different variant regions to useFields inherited from class mindustry.ctype.UnlockableContent
alwaysUnlocked, description, details, fullIcon, generateIcons, hideDetails, iconId, inlineDescription, localizedName, selectionSize, stats, techNode, techNodes, uiIcon, unlocked
Fields inherited from class mindustry.ctype.MappableContent
name
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<T extends mindustry.gen.Building>
void<T extends mindustry.gen.Building>
voidaddLiquidBar
(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.boolean
boolean
boolean
canPlaceOn
(Tile tile, Team team, int rotation) boolean
canReplace
(Block other) void
changePlacementPath
(Seq<Point2> points, int rotation) Mutates the given list of points used during line placement.void
changePlacementPath
(Seq<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
(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, Boolf<T> cons) Creates a consumer which only consumes power when the condition is met.<T extends mindustry.gen.Building>
ConsumePowerconsumePowerDynamic
(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.void
void
drawDefaultPlanRegion
(BuildPlan plan, 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, 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, Eachable<BuildPlan> list) void
drawPlanRegion
(BuildPlan plan, Eachable<BuildPlan> list) void
drawPotentialLinks
(int x, int y) void
drawShadow
(Tile tile) Never use outside of the editor!Never use outside of the editor!boolean
<T extends Consume>
TfindConsumer
(Boolf<Consume> filter) void
flipRotation
(BuildPlan req, boolean x) Returns the type name of this piece of content.void
getDependencies
(Cons<UnlockableContent> cons) Iterates through any implicit dependencies of this content.getDisplayIcon
(Tile tile) getDisplayName
(Tile tile) Point2[]
getEdges()
Point2[]
getPlanRegion
(BuildPlan plan, Eachable<BuildPlan> list) void
getReplacement
(BuildPlan req, Seq<BuildPlan> plans) void
handlePlacementLine
(Seq<BuildPlan> plans) Mutates the given list of plans used during line placement.boolean
boolean
hasConsumer
(Consume cons) protected 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
boolean
isVisibleOn
(Planet planet) void
iterateTaken
(int x, int y, 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
int
minimapColor
(Tile tile) void
nearbySide
(int x, int y, int rotation, int index, 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.int
planRotation
(int rot) pointConfig
(Object config, Cons<Point2> transformer) Transforms the internal position of this config using the specified function, and return the result.void
void
removeConsumer
(Consume cons) 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) 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 size) Methods inherited from class mindustry.ctype.UnlockableContent
checkStats, clearUnlock, displayDescription, displayExtra, emoji, getLogicId, hasEmoji, loadIcon, locked, makeOutline, makeOutline, makeOutline, onUnlock, quietUnlock, showUnlock, unlock, unlocked, 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. -
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 -
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 -
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 -
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. -
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. -
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. -
schematicPriority
public int schematicPriorityBuild queue priority in schematics. -
mapColor
The 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
Outlined 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
Sound made when this block is built. -
breakSound
Sound made when this block is deconstructed. -
destroySound
Sounds made when this block is destroyed. -
albedo
public float albedoHow reflective this block is. -
lightColor
Environmental passive light color. -
emitLight
public boolean emitLightWhether this environmental block passively emits light. Does not change behavior for non-environmental blocks, but still updates clipSize. -
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. -
loopSound
The sound that this block makes while active. One sound loop. Do not overuse. -
loopSoundVolume
public float loopSoundVolumeActive sound base volume. -
ambientSound
The 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. -
buildCost
public float buildCostTime to build this block in ticks; do not modify directly! -
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. -
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. -
instantTransfer
public boolean instantTransferWhether this block has instant transfer. -
quickRotate
public boolean quickRotateWhether you can rotate this block after it is placed. -
subclass
Main subclass. Non-anonymous. -
selectScroll
public float selectScrollScroll position for certain blocks. -
buildType
Building 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
-
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
-
editorIcon
-
customShadowRegion
-
teamRegion
-
teamRegions
-
variantRegions
-
variantShadowRegions
-
tempTiles
-
tempBuilds
-
timerDump
protected final int timerDumpDump timer ID. -
dumpTime
protected final int dumpTimeHow often to try dumping items in ticks, e.g. 5 = 12 times/sec- See Also:
-
-
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. -
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. -
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) -
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
Mutates the given list of points used during line placement. -
changePlacementPath
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
Configure when a null value is passed. -
config
Listen for a config by class type. -
isAccessible
public boolean isAccessible() -
nearbySide
sets to the index-th side outside of this block, using the given rotation. -
getEdges
-
getInsideEdges
-
iterateTaken
Iterate through ever grid position taken up by this block. -
editorIcon
Never use outside of the editor! -
editorVariantRegions
Never use outside of the editor! -
makeIconRegions
- Returns:
- special icons to outline and save with an -outline variant. Vanilla only.
-
icons
-
getRegionsToOutline
-
getGeneratedIcons
-
resetGeneratedIcons
public void resetGeneratedIcons() -
variantRegions
-
hasBuilding
public boolean hasBuilding() -
newBuilding
public final mindustry.gen.Building newBuilding() -
updateClipRadius
public void updateClipRadius(float size) -
bounds
-
isMultiblock
public boolean isMultiblock() -
isVisible
public boolean isVisible() -
isVisibleOn
-
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. -
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
-
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
Creates a consumer which only consumes power when the condition is met. -
consumePowerDynamic
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
-
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
-
sense
-
sense
-
senseObject
- Specified by:
senseObject
in interfaceSenseable
-