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 TypeFieldDescriptionbooleanwhether this block absorbs laser attacks.booleanVisual flag use for blending of certain transportation blocks.booleanIf true, payloads will attempt to move into this block.booleanIf true, this block can input payloads; affects unit payload enter behavior.floatHow reflective this block is.booleanIf true, the building inventory can be shown with the config.booleanIf true, this derelict block can be repair by clicking it.booleanIf false, diagonal placement (ctrl) for this block is not allowed.booleanWhether to allow rectangular placement, as opposed to a line.booleanwhether units can resupply by taking items from this blockbooleanwhether this block can be replaced in all casesbooleanif true, this block updates in payloads in units regardless of the experimental game rulearc.audio.SoundThe sound that this block makes while idle.floatIdle sound base volume.floatdamage absorption, similar to unit armorbooleanIf true, this block attacks and is considered a turret in the indexer.Array of affinities to certain things.booleanwhether to automatically reset enabled status after a logic block has not interacted for a while.Map of bars by name.floatbase block explosivenessfloatbase value for screen shake upon destructionbooleanwhether you can break this with rightclickEffect for breaking the block.booleanShould the sound made when this block is deconstructed change in pitch.arc.audio.SoundSound made when this block is deconstructed.floatMultiplier for speed of building this block.floatTime 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.booleanWhether the overdrive core has any effect on this block.booleanif true, this block can be picked up in payloadsCategory in place menu.booleanif true, double-tapping this configurable block clears configuration.floatClipping size of this block.booleanIf true, this building can be selected like a unit when commanding.booleanIf true, this block can conduct power like a cable.booleanWhether the block can be tapped and selected to configure.arc.struct.ObjectMap<Class<?>,arc.func.Cons2> Configuration handlers by type.booleanIf 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.booleanUsed by certain power blocks (nodes) to flag as non-consuming of power.booleanWhether this block consumes touchDown events when tapped.booleanWhether this block uses conveyor-type placement mode.booleanwhether to allow copying the config through middle clickbooleanwhether rubble is created when this block is destroyedfloatMultiplier of damage dealt to this block by tanks.booleanIf true, a custom shadow (name-shadow) is drawn under this block.arc.graphics.g2d.TextureRegionbooleanif false, only incinerable liquids are dropped when deconstructing; otherwise, all liquids are dropped.floatBuild completion at which deconstruction finishes.bullet that this block spawns when destroyedbooleanif true, destroyBullet is spawned on the block's team instead of Derelict teamEffect for destroying the block.floatRange of destroy sound.floatRange of destroy sound.arc.audio.SoundSounds made when this block is destroyed.booleanwhether this block has health and can be destroyedbooleanwhether to display flow ratebooleanwhether to draw a rotation arrow - this does not apply to lines of blocksbooleanwhether cracks are drawn when this block is damagedbooleanwhether to draw disabled statusbooleanWhether to draw the glow of the liquid for this block, if it has one.booleanwhether to draw the team corner by defaultintHow often to try dumping items in ticks, e.g.booleanif true,buildEditorConfig(Table)will be called for configuring this block in the editor.booleanIf true, drawLight() will be called for this block.booleanif false, the status is never drawnintThe environment flags that this block *cannot* function in.intThe environment flags that this block can function in.intEnvironmental flags that are *all* required for this block to function.floatscaling of explosiveness based on items/liquidsbooleanSpecial flag; if false, floor will be drawn under this block even if it is cached.arc.struct.EnumSet<BlockFlag>List of block flags.floatscaling of explosion flammability based on items/liquidsbooleanwhether this block can be placed on edges of liquids.intHow much fog this block uncovers, in tiles.booleanIf 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.booleanWhether this block has a minimap color.booleanSet to true if this block has any consumers in its array.booleanIf true, buildings have an ItemModule.booleanIf true, buildings have a LiquidModule.booleanIf true, buildings have a PowerModule.booleanWhether this block has a shadow under it.intbuilding health; -1 to use scaledHealthbooleanIf true, this block can be placed even in "dark" areas.booleanIf true, this block does not have pointConfig with a transform called on map resize.booleanwhether this block is visible in the editorbooleanIf true, this block constructs immediately.booleanIf true, this block deconstructs immediately.booleanWhether this block has instant transfer.booleanwhether this block has insulating properties.booleanif true, schematic flips with this block are inverted.booleanif true, this block acts a duct and will connect to armored ducts from the side.intmaximum 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.floatClipping size for lights only.arc.graphics.ColorEnvironmental passive light color.liquid used for lightingfloatRadius of the light emitted by this block.floatmaximum total liquids this block can carry if hasLiquids = trueboolean[]Consumption filters.floathigher numbers increase liquid output speed; TODO remove and replace with better liquids systembooleanif rotate = false and this is true, rotation will be locked at 0 when placing (default); advanced use onlybooleanIf true, this block can be configured by logic.arc.graphics.ColorThe color of this block when displayed on the minimap or map preview.Consume[]Array of consumers used by this block.booleanif true, this block does not accept input from the sides (used for armored conveyors)booleanif true, the block stops updating when disabledfloatmultiblock offsetConsume[]Array of consumers used by this block.arc.graphics.ColorOutlined icon color.intWhich of the icon regions gets the outline added.booleanWhether any icon region has an outline added.intOutline icon radius.booleanIf true, this block outputs to its facing direction, when applicable.booleanFlag for determining whether this block outputs liquid somewhere; used for connections.booleanIf true, this block can output payloads; affects blending.booleanIf true, this block is a generator that can produce power.booleanwhether this block can be placed on any liquids, anywherebooleanwhether this floor can be placed on.booleanwhether this block can be placed directly by the player via PlacementFragmentEffect for placing the block.floatWhen placeRangeCheck is enabled, this is the range checked for enemy blocks.booleanShould the sound made when this block is built change in pitch.arc.audio.SoundSound made when this block is built.booleanif true, this block cannot be mined by players.floatTargeting priority of this block, as seen by enemies.booleanif true, this logic-related block can only be used with privileged processors (or is one itself)booleanWhether you can rotate this block after it is placed.booleanwhether to add this block to brokenblocksarc.graphics.g2d.TextureRegionintRegions indexes from icons() that are rotated.intRegions indexes from icons() that are rotated.booleanif false, this block can never be replaced.Cost of constructing this block.booleanwhether this block can only be placed on waterOverride for research cost.floatMultiplier for cost of research in tech tree.arc.struct.ObjectFloatMap<Item>Cost multipliers per-item.booleanwhether this is rotatablebooleanif rotate is true and this is false, the region won't rotate when drawingbooleanif rotate is true and this is false, the region won't rotate when drawing in the editorbooleanwhether to save the last config and apply it to newly placed blocksbooleanfor static blocks only: if true, tile data() is saved in world data.floatHealth per square tile that this block occupies; essentially, this is multiplied by size * size.intBuild queue priority in schematics.intDefines how large selection menus, such as that of sorters, should be.intDefines how large selection menus, such as that of sorters, should be.floatScroll position for certain blocks.booleanIf true, all item capacities of this block are separate instead of pooled as one number.intmultiblock sizeintoffset for iteration (internal use only)booleanwhether this is solidbooleanwhether this block CAN be solid.booleanwhether the sprite is a full square.Class<?>Main subclass.booleanIf true, this block is mending-related and can be suppressed with special units/missiles.booleanWhether to swap the diagonal placement modes.booleanWhether to periodically sync this block across the network.booleanWhether units target this block.booleanif true, this counts as a non-solid block to this team.arc.graphics.g2d.TextureRegionarc.graphics.g2d.TextureRegion[]protected static final arc.struct.Seq<mindustry.gen.Building>protected static final arc.struct.Seq<Tile>protected final intDump timer ID.intMax of timers used.booleanif true, this block cannot be hit by bullets unless explicitly targeted.intHow much this block affects the unit cap by.booleanif true, this block will be broken by certain units stepping/moving over itbooleanwhether unloaders work on this blockbooleanwhether this block has a tile entity that updatesConsume[]Array of consumers used by this block.booleanif true, this block updates when it's a payload in a unit.booleanWhether to use this block's color in the minimap.arc.graphics.g2d.TextureRegion[]intnumber of different variant regions to usearc.graphics.g2d.TextureRegion[]floatvisual rotation offset used in broken plan renderingFields inherited from class mindustry.ctype.UnlockableContent
allDatabaseTabs, alwaysUnlocked, databaseTabs, description, details, fullIcon, fullOverride, generateIcons, hideDatabase, hideDetails, inlineDescription, localizedName, selectionSize, shownPlanets, stats, techNode, techNodes, uiIcon, unlockedFields 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.voidaddLiquidBar(Liquid liq) asFloor()voidbeforePlaceBegan(Tile tile, Block previous) Called right before building of this block begins.voidblockChanged(Tile tile) Called when this block is set on the specified tile.arc.math.geom.Rectbounds(int x, int y, arc.math.geom.Rect rect) voidbuildEditorConfig(arc.scene.ui.layout.Table table) Called to set up configuration UI in the editor.booleanbooleanbooleancanPlaceOn(Tile tile, Team team, int rotation) booleancanReplace(Block other) voidchangePlacementPath(arc.struct.Seq<arc.math.geom.Point2> points, int rotation) Mutates the given list of points used during line placement.voidchangePlacementPath(arc.struct.Seq<arc.math.geom.Point2> points, int rotation, boolean diagonalOn) Mutates the given list of points used during line placement.booleancheckForceDark(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.booleanconsumesItem(Item item) booleanconsumesLiquid(Liquid liq) voidcreateIcons(MultiPacker packer) Generate any special icons for this content.booleandisplayShadow(Tile tile) voidvoiddrawDefaultPlanRegion(BuildPlan plan, arc.util.Eachable<BuildPlan> list) this is a different method so subclasses can call it even after overriding the basevoiddrawEnvironmentLight(Tile tile) voiddrawOverlay(float x, float y, int rotation) Drawn when placing and when hovering over.voiddrawPlace(int x, int y, int rotation, boolean valid) Drawn when you are placing a block.floatdrawPlaceText(String text, int x, int y, boolean valid) voidvoidvoiddrawPlanConfig(BuildPlan plan, arc.util.Eachable<BuildPlan> list) voiddrawPlanConfigCenter(BuildPlan plan, Object content, String region) voiddrawPlanConfigCenter(BuildPlan plan, Object content, String region, boolean cross) voiddrawPlanConfigTop(BuildPlan plan, arc.util.Eachable<BuildPlan> list) voiddrawPlanRegion(BuildPlan plan, arc.util.Eachable<BuildPlan> list) voiddrawPotentialLinks(int x, int y) voiddrawShadow(Tile tile) voiddrawSideRegion(arc.graphics.g2d.TextureRegion region, float x, float y, int rotation) Draws a region to overlay a specific side of this block.voideditorPicked(Tile tile) Called when pick blocked in the editor.boolean<T extends Consume>
TfindConsumer(arc.func.Boolf<Consume> filter) voidflipRotation(BuildPlan req, boolean x) Returns the type name of this piece of content.voidgetDependencies(arc.func.Cons<UnlockableContent> cons) Iterates through any implicit dependencies of this content.arc.graphics.g2d.TextureRegiongetDisplayIcon(Tile tile) getDisplayName(Tile tile) arc.math.geom.Point2[]getEdges()arc.graphics.g2d.TextureRegion[]arc.math.geom.Point2[]voidgetPlanConfigs(arc.struct.Seq<UnlockableContent> options) Fills the specified array with the list of configuration options this block has.arc.graphics.g2d.TextureRegiongetPlanRegion(BuildPlan plan, arc.util.Eachable<BuildPlan> list) voidgetRegionsToOutline(arc.struct.Seq<arc.graphics.g2d.TextureRegion> out) getReplacement(BuildPlan req, arc.struct.Seq<BuildPlan> plans) voidhandlePlacementLine(arc.struct.Seq<BuildPlan> plans) Mutates the given list of plans used during line placement.booleanbooleanhasConsumer(Consume cons) protected arc.graphics.g2d.TextureRegion[]icons()voidinit()Called after all blocks are created.protected voidbooleanbooleanisAir()booleanisBanned()booleanisDarkened(Tile tile) If true, the 'map edge' darkness will be applied to this block.booleanisFloor()booleanisHidden()Whether this content is always hidden in the content database dialog.booleanbooleanbooleanbooleanisStatic()booleanvoiditerateTaken(int x, int y, arc.func.Intc2 placer) Iterate through ever grid position taken up by this block.listBars()voidload()Called after all content is created, only on non-headless versions.booleanarc.graphics.g2d.TextureRegion[]intminimapColor(Tile tile) voidnearbySide(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.BuildingvoidCalled when a new build plan is created in the player's queue.voidCalled when the block is picked (middle click).booleanfloatpercentSolid(int x, int y) voidplaceBegan(Tile tile, Block previous) Called when building of this block begins.voidplaceBegan(Tile tile, Block previous, mindustry.gen.Unit builder) Called when building of this block begins.voidplaceEnded(Tile tile, mindustry.gen.Unit builder, int rotation, Object config) Called when building of this block ends.intplanRotation(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.voidpostInit()Called after init().voidvoidremoveConsumer(Consume cons) voidremoveConsumers(arc.func.Boolf<Consume> b) voidrequirements(Category cat, ItemStack[] stacks) voidrequirements(Category cat, ItemStack[] stacks, boolean unlocked) voidrequirements(Category cat, BuildVisibility visible, ItemStack[] stacks) Sets up requirements.voidbooleanrotatedOutput(int x, int y) booleanrotatedOutput(int fromX, int fromY, Tile destination) doubledoublesenseObject(LAccess sensor) voidsetBars()voidsetStats()Initializes stats on demand.voidsetupRequirements(Category cat, ItemStack[] stacks) voidsetupRequirements(Category cat, BuildVisibility visible, ItemStack[] stacks) floatsumAttribute(Attribute attr, int x, int y) booleansupportsEnv(int env) booleanvoidupdateClipRadius(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, unlockedNowHostMethods inherited from class mindustry.ctype.MappableContent
toStringMethods 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 -
editorConfigurable
public boolean editorConfigurableif true,buildEditorConfig(Table)will be called for configuring this block 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 -
rotateDrawEditor
public boolean rotateDrawEditorif rotate is true and this is false, the region won't rotate when drawing in the editor -
visualRotationOffset
public float visualRotationOffsetvisual rotation offset used in broken plan rendering -
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 -
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 -
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
-
isDarkened
If true, the 'map edge' darkness will be applied to this block. -
setStats
public void setStats()Description copied from class:UnlockableContentInitializes stats on demand. Should only be called once. Only called before something is displayed.- Overrides:
setStatsin 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. -
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() -
isBanned
public boolean isBanned()- Overrides:
isBannedin classUnlockableContent
-
supportsEnv
public boolean supportsEnv(int env) - Returns:
- whether this block supports a specific environment.
-
buildEditorConfig
public void buildEditorConfig(arc.scene.ui.layout.Table table) Called to set up configuration UI in the editor.editorConfigurablemust be true. Config value should be assigned to lastConfig. -
onPicked
Called when the block is picked (middle click). Clientside only! -
getConfig
- Returns:
- the config value returned when this block is picked on a certain tile. This is only called for non-buildings.
-
blockChanged
Called when this block is set on the specified tile. -
placeBegan
Called when building of this block begins. -
placeBegan
Called when building of this block begins. -
placeEnded
public void placeEnded(Tile tile, @Nullable mindustry.gen.Unit builder, int rotation, @Nullable Object config) Called when building of this block ends. -
beforePlaceBegan
Called right before building of this block begins. -
editorPicked
Called when pick blocked in the editor. -
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:
researchRequirementsin classUnlockableContent- Returns:
- items needed to research this content
-
getDependencies
Description copied from class:UnlockableContentIterates through any implicit dependencies of this content. For blocks, this would be the items required to build it.- Overrides:
getDependenciesin classUnlockableContent
-
getContentType
Description copied from class:ContentReturns the type name of this piece of content. This should return the same value for all instances of this content type.- Specified by:
getContentTypein classContent
-
logicVisible
public boolean logicVisible()- Overrides:
logicVisiblein classUnlockableContent
-
postInit
public void postInit()Description copied from class:ContentCalled after init().- Overrides:
postInitin classUnlockableContent
-
init
public void init()Called after all blocks are created. -
load
public void load()Description copied from class:ContentCalled 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:UnlockableContentWhether this content is always hidden in the content database dialog.- Overrides:
isHiddenin classUnlockableContent
-
createIcons
Description copied from class:UnlockableContentGenerate any special icons for this content. Called synchronously. No regions are loaded at this point; grab pixmaps from the packer.- Overrides:
createIconsin 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:
senseObjectin interfaceSenseable
-