GenericCrafters - game-stuff-official/exampledustry GitHub Wiki
GenericCrafter
s are the most basic crafters. They simply consume items and liquids and output items and liquids.
Examples
- Exampledustry's Star Forge
- Mindustry's Carbide Crucible
Resources
- Mindustry Source Code
- Official Mindustry Wiki
Unique Properties
Name | Type | Default | What it means |
---|---|---|---|
outputItem | ItemStack | null | Use this when you want to have your crafter output only one item. |
outputItems | ItemStack Array | null | Use this property when you want your crafter to output multiple items. Overwrites outputItem. |
outputLiquid | LiquidStack | null | Use this to make your crafter output only one liquid. |
outputLiquids | LiquidStack Array | null | Use this to make your crafter output multiple liquids. Overwrites outputLiquid. Beware multiple output liquids may be hard to separate. |
liquidOutputDirections | Integer Array | {-1} | Controls how liquids are outputted. |
dumpExtraLiquid | Boolean | True | Will dump excess liquids. |
ignoreLiquidFullness | Boolean | False | If true, the block will stop functioning if it is filled with liquid. |
craftTime | Float/Ticks | 80.0 | How long your block will take to craft. |
craftEffect | Effect | none | What effect plays when your block crafts. |
updateEffect | Effect | none | What effect idly plays while crafter is active. |
updateEffectChance | Float | 0.04 | Chance the updateEffect will play each tick. |
warmupSpeed | Float | 0.019 | How quickly the crafter will activate. |
drawer | DrawBlock | DrawDefault() | What drawer the crafter will use when being displayed in game. |
Naming Conventions and File Location
Your crafter should go in content/blocks/crafting/[name].hjson
. Your sprites should go in sprites/blocks/crafting/[name].png
Sprites needed
Some crafters require multiple sprites.
[name]-top.png
is the top sprite you see on top of all the other sprites.
[name]-bottom-png
is the bottom sprite. It is shown under all your other sprites.
These are not the only regions and you can even specify your own regions using region:
in the drawer.
consumes
consumes
is the object used to specify what and how much power, resources, and liquid are needed to craft the output. Uses ItemStack
arrays.
consumes: {
power: 40
items: [
harcite/3
surge-alloy/1
explodium/2
]
}
Outputs
The output is what your GenericCrafter
spits out after it crafts. You can omit either ouputItems:
or ouputLiquids:
if you want your crafter not to make any of the respective items/liquids.
outputItems: [
charged-alloy/2
]
outputLiquids: [
oil/0.2
water/0.4
]
drawer
s.
Effects and craftEffect
The craftEffect
is an array that holds the effects played when your crafter crafts.
craftEffect: [
{
length: 60
lifetime: 15
particles: 10
interp: linear
sizeInterp: linear
region: circle
sizeFrom: 3
sizeTo: 0
colorFrom: ffffff
colorTo: b57bd4
}
]
This effect will create a burst of white particles that turn to purple.
updateEffect:
updateEffect:
is the effect played idly while the crafter is active. updateEffectChance:
is the chance that the updateEffect:
will play each tick.
Sounds
ambientSound
ambientSound:
is what sound will play while your crafter is active. It is an endlessly looping sound. Use ambientSoundVolume:
to specify how loud the sound is. The silicon smelter's volume is 0.09
.
ambientSound: smelter
ambientSoundVolume: 0.18
drawer
The drawer
is an array that holds information on how to draw your crafter. It draws from bottom to top. If you decide to omit the drawer then the default one will replace it.
drawer: [
{
type: DrawRegion
// This region is taken from [name]-bottom.png
suffix: -bottom
}
{
type: DrawCrucibleFlame
midColor: 7248a8 // Color of the central circle
flameColor: 472f80 // Color of particles and the ring around the central circle
flameRadiusMag: 3
flameRadiusScl: 7
flameRad: 2 // Size of the flame
alpha: 0.50 // How opaque the effect is
particleRad: 30 // How wide the particle effect as a whole will be.
rotateScl: 0.25 // How much the particles spin. Lower values give faster spins and vice versa.
particleSize: 5 // How large each particle lives for
particleLife: 60 // How many ticks a particle lives for
}
{
type: DrawRegion
// this region is taken from [name]-top.png
suffix: -top
}
{
type: DrawGlowRegion
// this region is taken from [name]-glow.png
suffix: -glow
color: eb7d6e // Color of the glow
}
]
This effect will draw the -bottom
sprite on the bottom then it will draw a DrawCrucibleFlame
on top of the bottom. A -top
sprite will then be drawn on top of both of the -bottom
region and the DrawCrudibleFlame
effect. Effects will not be shown until the crafter is active. Finally a glow effect will be drawn on top of the crafter when it is active.