Go: Custom dimensions¶
Functions¶
AddGeneratedDimension¶
| Go | |
|---|---|
AddGeneratedDimension registers a dimension whose terrain fill writes, and returns its id.
fill runs on the host's chunk worker threads, several at once: it must be safe to run concurrently, give the same answer for the same chunk forever, and call nothing on this package but the request itself. Returning false leaves the chunk to air. materials[0] must be "minecraft:air". The function is kept for the dimension's whole life.
- Parameters:
- name :
string - spec :
string - materials :
[]string - biomes :
[]string - fill :
func(*ChunkRequest) bool
- name :
- Return type:
(int32, error) - Slots:
md_add_dimension_generated
DimensionsAvailable¶
| Go | |
|---|---|
DimensionsAvailable reports whether this host can register custom dimensions.
- Return type:
(bool, error) - Slots:
md_is_available
AddDimension¶
| Go | |
|---|---|
AddDimension registers a dimension from spec SNBT and returns its id.
- Parameters:
- name :
string - spec :
string
- name :
- Return type:
(int32, error) - Slots:
md_add_dimension
DimensionID¶
| Go | |
|---|---|
DimensionID is the id of a registered dimension.
- Parameters:
- name :
string
- name :
- Return type:
(int32, error) - Slots:
md_get_dimension_id
ListDimensions¶
| Go | |
|---|---|
ListDimensions lists the registered custom dimensions.
- Return type:
([]string, error) - Slots:
md_list_dimensions
SetDimensionRule¶
| Go | |
|---|---|
SetDimensionRule sets one rule, a PIER_DIMRULE_* value, for one dimension.
- Parameters:
- dim :
int32 - rule :
int32 - allow :
bool
- dim :
- Return type:
error - Slots:
md_set_dimension_rule
DimensionRule¶
| Go | |
|---|---|
DimensionRule reads one rule; set is false when the dimension follows vanilla for it, which a host older than the rule also answers.
- Parameters:
- dim :
int32 - rule :
int32
- dim :
- Return type:
(allow, set bool, err error) - Slots:
md_get_dimension_rule
ChunkRequest¶
| Go | |
|---|---|
ChunkRequest is one chunk a supplied-terrain generator fills. Materials has 256*Height entries indexed (x*16+z)*Height + (y-MinY), and Biomes 256, one per column; both hold indices into the palettes given at registration, and material 0 is air.