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): Noise2DFastNoiseLiteof 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>): Noise2DCellto value via a function
: Gets the.cell(x: double, z: double): CellCellat the given x-z point.Cellis 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): Noise3DFastNoiseLiteof 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): Noise2DNoise3Dto aNoise2Dby using the providedNoise2Das 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): CellCellat the given x-y-z point.Cellis 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(): ChunkPosChunkPosthat data is attached to
: Get the chunk’s.getRockData(): RockDataRockData
: 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]QuartPosresolution
: 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(): ForestTypeForestType
: Get the chunk’s forest weirdness value.getForestWeirdness(): float
: Get the chunk’s forest density value.getForestDensity(): float
: Gets the.status(): ChunkData$StatusStatusof the chunk data
: Promotes the chunk data to.generatePartial(...): voidPARTIALfromEMPTYand fills in the temperature, rainfall, and forest values of the chunk. Has five parameters, in order they are:rainfallLayer: LerpFloatLayer: ALerpFloatLayerof the yearly average rainfall at the corners of the chunk. Using in climate models to determine the rainfall at a positiontemperatureLayer: LerpFloatLayer: ALerpFloatLayerof 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_growthforestWeirdness: 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(...): voidPARTIALtoFULLand 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 size2561 representing the surface height of the world. Values indexes arex + 16 * zwherexandzare the local x and z coordinates within the chunk and are in the range [0, 15]. For custom chunk data providers, this is where thesurfaceYparameter of theRocksGettercallback is gotten fromaquiferSurfaceHeight: int[16]: An array of integer values of size162 representing the height of aquifer surfaces. Only used byTFCAquifers
LayeredArea
LayeredArea is a specialized version of TFC’s Area, an AreaSource overlaid with multiple TransformLayers 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 LayeredAreafuzzy: 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 LayeredAreaAreaContext’s random
: Applies an arbitrary.transform(transformer: TransformLayer, seed: long): @Self LayeredAreaTransformLayerto 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 LayeredAreaTransformLayerthat 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 LayeredAreaLayeredAreawith another via the givenMergelayer. The params are:merger: MergeLayer: A callback which merges the twoLayeredAreas together. Has the following params:context: AreaContext: The seededAreaContextat the pointfirst: Area: TheAreafrom thisLayeredAreasecond: Area: TheAreafrom the otherLayeredAreax: int: The x position being queriedz: int: The z position being queriedreturn: int: The return value
otherLayeredArea: LayeredArea: TheLayeredAreato 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 seededAreaContextat 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: TheAreaContextof the layerarea: Area: TheAreaof theLayeredAreax: 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: TheAreaContextof the layernorth: int: The value immediately north of thecenterpositioneast: int: The value immediately east of thecenterpositionsouth: int: The value immediately south of thecenterpositionwest: int: The value immediately west of thecenterpositioncenter: 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 theRandomSourceused 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
Areas 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(): TFCTreeGrowerTFCTreeGrowerof 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(): numberfoliage_fallcolormap 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(): BlockSetTypeBlockSetTypeof the wood
: Get the vanilla wood type of the wood.getVanillaWoodType(): WoodType
: Get the name of the wood.getSerializedName(): String