Type Explanations
Lists and describes the methods available on
Noise2D
Noise2D
is TFC’s base type for noise functions with two dimensions. It has the following methods:
: Gets the value of the noise at the given x-z point.noise(x: double, z: double): Noise2D
: Applies an octave function to the noise, overlaying weaker, more spread copies of the noise on top of itself.octaves(octaves: int): Noise2D
: Creates a ridged noise using absolute values. Expects the noise’s value to be in the range [-1, 1].ridged(): Noise2D
: Takes the absolute value of the function.abs(): Noise2D
: Creates ‘terraces’ by taking the nearest level and rounding. Expects the noise’s value to be in the range [-1, 1].terraces(levels: int): Noise2D
: Scales the input dimension of the noise by the given scale factor.spread(scaleFactor: double): Noise2D
: Maps the output value, expected to be in the range [-1, 1], to the given min and max values.scaled(min: double, max: double): Noise2D
: Re-scales the output of the noise to a new range.scaled(oldMin: double, oldMax: double, min: double, max: double): Noise2D
: Scales then shifts the noise output.affine(scale: double, shift: double): Noise2D
: Uses the.warped(warp: OpenSimplex2D): Noise2D
FastNoiseLite
of the simplex noise to domain warp this noise
: Clamps the noise to the given range.clamped(min: double, max: double): Noise2D
: Sums this noise and the other.add(noise: Noise2D): Noise2D
: Multiplies the two noises.lazyProduct(other: Noise2D): Noise2D
: Maps the output of this noise by the given function.map(mappingFunction: Function<double, double>): Noise2D
: Swaps the input axes.transpose(): Noise2D
: Rotates the input axes by the given angle (in degrees).rotate(angle: double): Noise2D
OpenSimplex2D
OpenSimplex2D
is an implementation of Noise2D
which uses FastNoiseLite
’s OpenSimplex
noise type.
Cellular2D
Cellular2D
is an implementation of Noise2D
specialized to have polygonal blobs of constant value, instead of smooth, constantly changing values. It has these additional methods:
: Converts the.then(func: Function<Cell, double>): Noise2D
Cell
to value via a function
: Gets the.cell(x: double, z: double): Cell
Cell
at the given x-z point.Cell
is an object with the following methods.x()
: The x ‘coordinate’ of the center of this cell.y()
: The y ‘coordinate’ of the center of this cell.cx()
: The x ‘coordinate’ of this cell.cy()
: The y ‘coordinate’ of this cell.f1()
: The normalized distance from the center of a cell.f2()
: The normalized distance from the center of a edge of a cell.noise()
: The noise value of the cell
Noise3D
Noise3D
is TFC’s base type for noise functions with with tree dimensions. It has the following methods:
: Gets the value of noise at the give x-y-z point.noise(x: double, y: double, z: double): Noise3D
: Applies an octave function to this noise, overlaying weaker, more spread out copies of the noise on top of itself.octaves(octaves: int): Noise3D
: Scales the input dimensions of the noise by the given scale factor.spread(scaleFactor: double): Noise3D
: Maps the output value, expected to be in the range [-1, 1], to the given min and max values.scaled(min: double, max: double): Noise3D
: Re-scales the output of the noise to a new range.scaled(oldMin: double, oldMax: double, min: double, max: double): Noise3D
: Uses the.warped(warp: OpenSimplex3D): Noise3D
FastNoiseLite
of the simplex noise to domain warp this noise
: Swaps the x and z axes.transposeXZ(): Noise3D
: Swaps the x and y axes.transposeXY(): Noise3D
: Swaps the y and z axes.transposeYZ(): Noise3D
: Dissolves the.dissolve(yNoise: Noise2D): Noise2D
Noise3D
to aNoise2D
by using the providedNoise2D
as the input y-value at a given x-z coordinate
: Rotates the noise around the x axis.rotateX(angle: double): Noise3D
: Rotates the noise around the y axis.rotateY(angle: double): Noise3D
: Rotates the noise around the z axis.rotateZ(angle: double): Noise3D
OpenSimplex3D
OpenSimplex3D
is an implementation of Noise3D
which uses FastNoiseLite
’s OpenSimplex
noise type
Cellular3D
Cellular3D
is an implementation of Noise3D
specialized to have polyhedral blobs of constant value, instead of smooth, constantly changing values. It has these additional methods:
: Gets the.cell(x: double, y: double, z: double): Cell
Cell
at the given x-y-z point.Cell
is an object with the following methods:.x()
: The x ‘coordinate’ of the cell.y()
: The y ‘coordinate’ of the cell.z()
: The z ‘coordinate’ of the cell.f1()
: The normalized distance from the center of a cell.f2()
: The normalized distance from the center of a face of a cell.noise()
: The noise value of the cell
ChunkData
ChunkData
is TFC’s additional data it attaches to chunks during chunk generation for use during and after world generation. It has the following methods:
: Get the.getPos(): ChunkPos
ChunkPos
that data is attached to
: Get the chunk’s.getRockData(): RockData
RockData
: Get the chunk’s aquifer surface heights as an array of ints. The array has sixteen elements, representing aquifer heights at a.getAquiferSurfaceHeight(): int[16]
QuartPos
resolution
: Get the interpolated rainfall value at the given position.getRainfall(pos: BlockPos): float
: Get the interpolated rainfall value at the given x and z coordinates.getRainfall(x: int, z: int): float
: Get the interpolated average temperature value at the given position.getAverageTemperature(pos: BlockPos): float
: Get the interpolated average temperature value at the given x and z coordinates.getAverageTemperature(x: int, z: int): float
: Get the chunk’s.getForestType(): ForestType
ForestType
: Get the chunk’s forest weirdness value.getForestWeirdness(): float
: Get the chunk’s forest density value.getForestDensity(): float
: Gets the.status(): ChunkData$Status
Status
of the chunk data
: Promotes the chunk data to.generatePartial(...): void
PARTIAL
fromEMPTY
and fills in the temperature, rainfall, and forest values of the chunk. Has five parameters, in order they are:rainfallLayer: LerpFloatLayer
: ALerpFloatLayer
of the yearly average rainfall at the corners of the chunk. Using in climate models to determine the rainfall at a positiontemperatureLayer: LerpFloatLayer
: ALerpFloatLayer
of the yearly average temperature at the corners of the chunk. Used by climate models to determine the average temperature at a positionforestType: ForestType
: The forest type of the chunk, may benone
,sparse
,edge
,normal
, orold_growth
forestWeirdness: float
: The forest ‘weirdness’ of the chunk, in the range [0, 1]. Used by TFC’s forest configured featureforestDensity: float
: The forest density of the chunk, in the range [0, 1]. Used by TFC’s forest configured feature
: Promotes the chunk data from.generateFull(...): void
PARTIAL
toFULL
and fills in the chunk’s surface and aquifer heights. Has two parameters, in order they are:surfaceHeight: int[256]
: An array of integer values of size256
1 representing the surface height of the world. Values indexes arex + 16 * z
wherex
andz
are the local x and z coordinates within the chunk and are in the range [0, 15]. For custom chunk data providers, this is where thesurfaceY
parameter of theRocksGetter
callback is gotten fromaquiferSurfaceHeight: int[16]
: An array of integer values of size16
2 representing the height of aquifer surfaces. Only used byTFCAquifer
s
LayeredArea
LayeredArea
is a specialized version of TFC’s Area
, an AreaSource
overlaid with multiple TransformLayer
s which can be thought of as a pseudo-Noise2D
, designed to be easily made, edited, and used in scripts. It has the following methods:
: Gets the value at the given x-z point.getAt(x: int, z: int): int
: Applies a zoom layer to the area, effectively doubling the ‘resolution’ of the area. The params are:.zoom(fuzzy: boolean, seed: long): @Self LayeredArea
fuzzy: boolean
: If the zooming function should apply a smoothing operation along value boundariesseed: long
: The seed for theAreaContext
’s random
: Applies a smoothing layer to the area. The param is the seed used by the.smooth(seed: long): @Self LayeredArea
AreaContext
’s random
: Applies an arbitrary.transform(transformer: TransformLayer, seed: long): @Self LayeredArea
TransformLayer
to the area. The params are:transformer: TransformLayer
: The transformerseed: long
: The seed used by theAreaContext
’s random
: Applies an arbitrary.adjacentTransform(transformer: AdjacentTransformLayer, seed: long): @Self LayeredArea
TransformLayer
that has access to neighboring values. The params are:transformer: AdjacentTransformLayer
: The transformerseed: long
: The seed used by theAreaContext
’s random
: Merges this.merge(merger: MergeLayer, otherLayeredArea: LayeredArea, seed: long): @Self LayeredArea
LayeredArea
with another via the givenMergelayer
. The params are:merger: MergeLayer
: A callback which merges the twoLayeredArea
s together. Has the following params:context: AreaContext
: The seededAreaContext
at the pointfirst: Area
: TheArea
from thisLayeredArea
second: Area
: TheArea
from the otherLayeredArea
x: int
: The x position being queriedz: int
: The z position being queriedreturn: int
: The return value
otherLayeredArea: LayeredArea
: TheLayeredArea
to merge with this oneseed: long
: The seed by theAreaContext
’s random
SourceLayer
SourceLayer
is a functional interface that originates a LayeredArea
. It can be created in scripts as a callback with the params:
context: AreaContext
: The seededAreaContext
at the pointx: int
: The x position being queriedz: int
: The z position being queriedreturn: int
: The return value
TransformLayer
Transformlayer
is a functional interface that transforms the result of a LayeredArea
. It can be created in scripts as a callback with the following params:
context: AreaContext
: TheAreaContext
of the layerarea: Area
: TheArea
of theLayeredArea
x: int
: The x position being queriedz: int
: The z position being queriedreturn: int
: The return value
AdjacentTransformLayer
AdjacentTransformlayer
is a functional interface that transforms the result of a LayeredArea
. It can be created in scripts as a callback with the following params:
context: AreaContext
: TheAreaContext
of the layernorth: int
: The value immediately north of thecenter
positioneast: int
: The value immediately east of thecenter
positionsouth: int
: The value immediately south of thecenter
positionwest: int
: The value immediately west of thecenter
positioncenter: int
: The value at the queried positionreturn: int
: The return value
AreaContext
AreaContext
is an object which provides some utility methods for making random choices in layer transformations. it has the following methods:
.random(): RandomSource
: Gets theRandomSource
used by the context to make choices.choose(first: int, second: int): int
: Randomly chooses between the two options and returns the selection.choose(first: int, second: int, third: int, fourth: int): int
: Randomly chooses between the four options and returns the selection
Area
Area
s are objects which represent a value source and the sum contribution of all layers applied to a LayeredArea
. It has one method:
.get(x: int, z: int): int
: Gets the value at the given x-z point
NamedRegistryMetal
A NamedRegistryMetal
is an easy way to access the items, blocks, and fluid associated with a metal. It has the following methods:
: Get the mod id the metal is added by.getMod(): String
: Get a possibly null supplier for the block of the given type. Accepts.getBlock(type: Metal$BlockType): @Nullable Supplier<Block>
anvil
,block
,block_slab
,block_stairs
,bars
,chain
,lamp
, ortrapdoor
: Get a possibly null supplier for the item of the given type. Accepts.getItem(type: Metal$ItemType): @Nullable Supplier<Item>
ingot
,double_ingot
,sheet
,double_sheet
,rod
,tuyere
,fish_hook
,fishing_rod
,unfinished_lamp
,pickaxe
,pickaxe_head
,propick
,propick_head
,axe
,axe_head
,shovel
,shovel_head
,hoe
,hoe_head
,chisel
,chisel_head
,hammer
,hammer_head
,saw
,saw_head
,javelin
,javelin_head
,sword
,sword_blade
,mace
,mace_head
,knife
,knife_head
,scythe
,scythe_head
,shears
,unhinished_helmet
,helmet
,unfinished_chestplate
,chestplate
,unfinished_greaves
,greaves
,unfinished_boots
,boots
,horse_armor
, orshield
: Get the possibly null supplier for the source fluid of the metal.getFluid(): @Nullable Supplier<Fluid>
: Get the tool tier of the metal and all tools it contains.toolTier(): ToolTier
: Get the armor material of the metal and all armor pieces it contains.armorTier(): ArmorMaterial
: Get the tier of the metal, typically the tier of working recipes its metal can handle.metalTier(): Metal$Tier
: Get a supplier for the metal’s full block.getFullBlock(): Supplier<Block>
: Get the map color of the blocks contained by this metal.mapColor(): MapColor
: Get the rarity of the items contained by this metal.getRarity(): Rarity
: Get the name of the metal.getSerializedName(): String
NamedRegistryWood
A NamedRegistryWood
is an easy way to access the blocks associated with a wood type. It has the following methods:
: Get the mod id the wood is added by.getMod(): String
: Get the map color of the blocks contained by the wood.woodColor(): MapColor
: Get the map color of the barks of the wood.barkColor(): MapColor
: Get the.tree(): TFCTreeGrower
TFCTreeGrower
of the wood
: Gets the number of days it takes for the wood’s sapling to grow.daysToGrow(): number
: Get the vertical coordinate, in the range [0, 255], on the.autumnIndex(): number
foliage_fall
colormap for this wood’s leaves
: Get a possibly null supplier for the block of the given type. Accepts.getBlock(type: Wood$BlockType): @Nullable Supplier<Block>
log
,stripped_log
,wood
,stripped_wood
,leaveas
,planks
,sapling
,potted_sapling
,bookshelf
,door
,trapdoor
,fence
,log_fence
,fence_gate
,button
,pressure_plate
,slab
,stairs
,too_rack
,twig
,fallen_leaves
,vertical_support
,horizontal_support
,workbench
,trapped_chest
,chest
,loom
,sluice
,sign
,wall_sign
,barrel
,lectern
,scribing_table
,sewing_table
,jar_shelf
,axle
,bladed_axle
,encased_axle
,clutch
,gear_box
,windmill
, orwater_wheel
: Get the vanilla.getBlockSet(): BlockSetType
BlockSetType
of the wood
: Get the vanilla wood type of the wood.getVanillaWoodType(): WoodType
: Get the name of the wood.getSerializedName(): String