nucleation 0.2.4 → 0.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/nucleation-original.js +315 -200
- package/nucleation.d.ts +403 -353
- package/nucleation_bg.wasm +0 -0
- package/package.json +1 -1
package/nucleation-original.js
CHANGED
|
@@ -1401,6 +1401,21 @@ export class DefinitionRegionWrapper {
|
|
|
1401
1401
|
const ret = wasm.definitionregionwrapper_metadataKeys(this.__wbg_ptr);
|
|
1402
1402
|
return ret;
|
|
1403
1403
|
}
|
|
1404
|
+
/**
|
|
1405
|
+
* Fluent alias for `setMetadata` — returns the region for chaining.
|
|
1406
|
+
* @param {string} key
|
|
1407
|
+
* @param {string} value
|
|
1408
|
+
* @returns {DefinitionRegionWrapper}
|
|
1409
|
+
*/
|
|
1410
|
+
withMetadata(key, value) {
|
|
1411
|
+
const ptr = this.__destroy_into_raw();
|
|
1412
|
+
const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1413
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1414
|
+
const ptr1 = passStringToWasm0(value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1415
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1416
|
+
const ret = wasm.definitionregionwrapper_setMetadata(ptr, ptr0, len0, ptr1, len1);
|
|
1417
|
+
return DefinitionRegionWrapper.__wrap(ret);
|
|
1418
|
+
}
|
|
1404
1419
|
/**
|
|
1405
1420
|
* Create a DefinitionRegion from an array of positions
|
|
1406
1421
|
*
|
|
@@ -3820,6 +3835,22 @@ export class SchematicBuilderWrapper {
|
|
|
3820
3835
|
const ptr = this.__destroy_into_raw();
|
|
3821
3836
|
wasm.__wbg_schematicbuilderwrapper_free(ptr, 0);
|
|
3822
3837
|
}
|
|
3838
|
+
/**
|
|
3839
|
+
* Serialize the builder back into the canonical template format.
|
|
3840
|
+
* @returns {string}
|
|
3841
|
+
*/
|
|
3842
|
+
toTemplate() {
|
|
3843
|
+
let deferred1_0;
|
|
3844
|
+
let deferred1_1;
|
|
3845
|
+
try {
|
|
3846
|
+
const ret = wasm.schematicbuilderwrapper_toTemplate(this.__wbg_ptr);
|
|
3847
|
+
deferred1_0 = ret[0];
|
|
3848
|
+
deferred1_1 = ret[1];
|
|
3849
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
3850
|
+
} finally {
|
|
3851
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
3852
|
+
}
|
|
3853
|
+
}
|
|
3823
3854
|
/**
|
|
3824
3855
|
* Create from template string
|
|
3825
3856
|
* @param {string} template
|
|
@@ -3834,6 +3865,34 @@ export class SchematicBuilderWrapper {
|
|
|
3834
3865
|
}
|
|
3835
3866
|
return SchematicBuilderWrapper.__wrap(ret[0]);
|
|
3836
3867
|
}
|
|
3868
|
+
/**
|
|
3869
|
+
* Apply the compact palette (single-glyph redstone shapes).
|
|
3870
|
+
* @returns {SchematicBuilderWrapper}
|
|
3871
|
+
*/
|
|
3872
|
+
useCompactPalette() {
|
|
3873
|
+
const ptr = this.__destroy_into_raw();
|
|
3874
|
+
const ret = wasm.schematicbuilderwrapper_useCompactPalette(ptr);
|
|
3875
|
+
return SchematicBuilderWrapper.__wrap(ret);
|
|
3876
|
+
}
|
|
3877
|
+
/**
|
|
3878
|
+
* Apply the minimal palette (`c` and space only).
|
|
3879
|
+
* @returns {SchematicBuilderWrapper}
|
|
3880
|
+
*/
|
|
3881
|
+
useMinimalPalette() {
|
|
3882
|
+
const ptr = this.__destroy_into_raw();
|
|
3883
|
+
const ret = wasm.schematicbuilderwrapper_useMinimalPalette(ptr);
|
|
3884
|
+
return SchematicBuilderWrapper.__wrap(ret);
|
|
3885
|
+
}
|
|
3886
|
+
/**
|
|
3887
|
+
* Apply the standard palette (gray concrete, air, plus the
|
|
3888
|
+
* named-direction characters used in the canonical examples).
|
|
3889
|
+
* @returns {SchematicBuilderWrapper}
|
|
3890
|
+
*/
|
|
3891
|
+
useStandardPalette() {
|
|
3892
|
+
const ptr = this.__destroy_into_raw();
|
|
3893
|
+
const ret = wasm.schematicbuilderwrapper_useStandardPalette(ptr);
|
|
3894
|
+
return SchematicBuilderWrapper.__wrap(ret);
|
|
3895
|
+
}
|
|
3837
3896
|
/**
|
|
3838
3897
|
* Map a character to a block string
|
|
3839
3898
|
* @param {string} ch
|
|
@@ -3882,6 +3941,20 @@ export class SchematicBuilderWrapper {
|
|
|
3882
3941
|
}
|
|
3883
3942
|
return SchematicWrapper.__wrap(ret[0]);
|
|
3884
3943
|
}
|
|
3944
|
+
/**
|
|
3945
|
+
* Append a single layer (`string[]` of rows). Equivalent to
|
|
3946
|
+
* `layers([rows])` but doesn't require nesting for a single layer.
|
|
3947
|
+
* @param {any} rows
|
|
3948
|
+
* @returns {SchematicBuilderWrapper}
|
|
3949
|
+
*/
|
|
3950
|
+
layer(rows) {
|
|
3951
|
+
const ptr = this.__destroy_into_raw();
|
|
3952
|
+
const ret = wasm.schematicbuilderwrapper_layer(ptr, rows);
|
|
3953
|
+
if (ret[2]) {
|
|
3954
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
3955
|
+
}
|
|
3956
|
+
return SchematicBuilderWrapper.__wrap(ret[0]);
|
|
3957
|
+
}
|
|
3885
3958
|
/**
|
|
3886
3959
|
* Add multiple layers (array of arrays of strings)
|
|
3887
3960
|
* @param {any} layers
|
|
@@ -3895,6 +3968,43 @@ export class SchematicBuilderWrapper {
|
|
|
3895
3968
|
}
|
|
3896
3969
|
return SchematicBuilderWrapper.__wrap(ret[0]);
|
|
3897
3970
|
}
|
|
3971
|
+
/**
|
|
3972
|
+
* Set the world offset of the resulting schematic.
|
|
3973
|
+
* @param {number} x
|
|
3974
|
+
* @param {number} y
|
|
3975
|
+
* @param {number} z
|
|
3976
|
+
* @returns {SchematicBuilderWrapper}
|
|
3977
|
+
*/
|
|
3978
|
+
offset(x, y, z) {
|
|
3979
|
+
const ptr = this.__destroy_into_raw();
|
|
3980
|
+
const ret = wasm.schematicbuilderwrapper_offset(ptr, x, y, z);
|
|
3981
|
+
return SchematicBuilderWrapper.__wrap(ret);
|
|
3982
|
+
}
|
|
3983
|
+
/**
|
|
3984
|
+
* Bulk version of `map`. Pass either an `Object` literal
|
|
3985
|
+
* (`{ c: "minecraft:stone", " ": "minecraft:air" }`) or an array
|
|
3986
|
+
* of `[char, block]` pairs.
|
|
3987
|
+
* @param {any} mappings
|
|
3988
|
+
* @returns {SchematicBuilderWrapper}
|
|
3989
|
+
*/
|
|
3990
|
+
palette(mappings) {
|
|
3991
|
+
const ptr = this.__destroy_into_raw();
|
|
3992
|
+
const ret = wasm.schematicbuilderwrapper_palette(ptr, mappings);
|
|
3993
|
+
if (ret[2]) {
|
|
3994
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
3995
|
+
}
|
|
3996
|
+
return SchematicBuilderWrapper.__wrap(ret[0]);
|
|
3997
|
+
}
|
|
3998
|
+
/**
|
|
3999
|
+
* Run pre-build validation. Throws if the layered template is
|
|
4000
|
+
* malformed (missing palette mapping, ragged rows, etc.).
|
|
4001
|
+
*/
|
|
4002
|
+
validate() {
|
|
4003
|
+
const ret = wasm.schematicbuilderwrapper_validate(this.__wbg_ptr);
|
|
4004
|
+
if (ret[1]) {
|
|
4005
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
4006
|
+
}
|
|
4007
|
+
}
|
|
3898
4008
|
}
|
|
3899
4009
|
if (Symbol.dispose) SchematicBuilderWrapper.prototype[Symbol.dispose] = SchematicBuilderWrapper.prototype.free;
|
|
3900
4010
|
|
|
@@ -3916,6 +4026,205 @@ export class SchematicWrapper {
|
|
|
3916
4026
|
const ptr = this.__destroy_into_raw();
|
|
3917
4027
|
wasm.__wbg_schematicwrapper_free(ptr, 0);
|
|
3918
4028
|
}
|
|
4029
|
+
/**
|
|
4030
|
+
* Generate raw mesh data for custom rendering pipelines.
|
|
4031
|
+
* @param {ResourcePackWrapper} pack
|
|
4032
|
+
* @param {MeshConfigWrapper} config
|
|
4033
|
+
* @returns {RawMeshExportWrapper}
|
|
4034
|
+
*/
|
|
4035
|
+
toRawMesh(pack, config) {
|
|
4036
|
+
_assertClass(pack, ResourcePackWrapper);
|
|
4037
|
+
_assertClass(config, MeshConfigWrapper);
|
|
4038
|
+
const ret = wasm.schematicwrapper_toRawMesh(this.__wbg_ptr, pack.__wbg_ptr, config.__wbg_ptr);
|
|
4039
|
+
if (ret[2]) {
|
|
4040
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
4041
|
+
}
|
|
4042
|
+
return RawMeshExportWrapper.__wrap(ret[0]);
|
|
4043
|
+
}
|
|
4044
|
+
/**
|
|
4045
|
+
* Generate one mesh per 16x16x16 chunk (eager, all at once).
|
|
4046
|
+
* @param {ResourcePackWrapper} pack
|
|
4047
|
+
* @param {MeshConfigWrapper} config
|
|
4048
|
+
* @returns {ChunkMeshResultWrapper}
|
|
4049
|
+
*/
|
|
4050
|
+
meshByChunk(pack, config) {
|
|
4051
|
+
_assertClass(pack, ResourcePackWrapper);
|
|
4052
|
+
_assertClass(config, MeshConfigWrapper);
|
|
4053
|
+
const ret = wasm.schematicwrapper_meshByChunk(this.__wbg_ptr, pack.__wbg_ptr, config.__wbg_ptr);
|
|
4054
|
+
if (ret[2]) {
|
|
4055
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
4056
|
+
}
|
|
4057
|
+
return ChunkMeshResultWrapper.__wrap(ret[0]);
|
|
4058
|
+
}
|
|
4059
|
+
/**
|
|
4060
|
+
* Generate a Minecraft item model using the plane-based approach.
|
|
4061
|
+
* @param {ResourcePackWrapper} pack
|
|
4062
|
+
* @param {ItemModelConfigWrapper} config
|
|
4063
|
+
* @returns {ItemModelResultWrapper}
|
|
4064
|
+
*/
|
|
4065
|
+
toItemModel(pack, config) {
|
|
4066
|
+
_assertClass(pack, ResourcePackWrapper);
|
|
4067
|
+
_assertClass(config, ItemModelConfigWrapper);
|
|
4068
|
+
const ret = wasm.schematicwrapper_toItemModel(this.__wbg_ptr, pack.__wbg_ptr, config.__wbg_ptr);
|
|
4069
|
+
if (ret[2]) {
|
|
4070
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
4071
|
+
}
|
|
4072
|
+
return ItemModelResultWrapper.__wrap(ret[0]);
|
|
4073
|
+
}
|
|
4074
|
+
/**
|
|
4075
|
+
* Generate one mesh per region.
|
|
4076
|
+
* @param {ResourcePackWrapper} pack
|
|
4077
|
+
* @param {MeshConfigWrapper} config
|
|
4078
|
+
* @returns {MultiMeshResultWrapper}
|
|
4079
|
+
*/
|
|
4080
|
+
meshByRegion(pack, config) {
|
|
4081
|
+
_assertClass(pack, ResourcePackWrapper);
|
|
4082
|
+
_assertClass(config, MeshConfigWrapper);
|
|
4083
|
+
const ret = wasm.schematicwrapper_meshByRegion(this.__wbg_ptr, pack.__wbg_ptr, config.__wbg_ptr);
|
|
4084
|
+
if (ret[2]) {
|
|
4085
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
4086
|
+
}
|
|
4087
|
+
return MultiMeshResultWrapper.__wrap(ret[0]);
|
|
4088
|
+
}
|
|
4089
|
+
/**
|
|
4090
|
+
* Build a single shared texture atlas from all unique block states.
|
|
4091
|
+
*
|
|
4092
|
+
* The atlas can be reused across all chunks via `chunkMeshIteratorWithAtlas()`,
|
|
4093
|
+
* eliminating per-chunk atlas duplication for massive schematics.
|
|
4094
|
+
* @param {ResourcePackWrapper} pack
|
|
4095
|
+
* @param {MeshConfigWrapper} config
|
|
4096
|
+
* @returns {TextureAtlasWrapper}
|
|
4097
|
+
*/
|
|
4098
|
+
buildGlobalAtlas(pack, config) {
|
|
4099
|
+
_assertClass(pack, ResourcePackWrapper);
|
|
4100
|
+
_assertClass(config, MeshConfigWrapper);
|
|
4101
|
+
const ret = wasm.schematicwrapper_buildGlobalAtlas(this.__wbg_ptr, pack.__wbg_ptr, config.__wbg_ptr);
|
|
4102
|
+
if (ret[2]) {
|
|
4103
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
4104
|
+
}
|
|
4105
|
+
return TextureAtlasWrapper.__wrap(ret[0]);
|
|
4106
|
+
}
|
|
4107
|
+
/**
|
|
4108
|
+
* Generate one mesh per chunk of the specified size (eager).
|
|
4109
|
+
* @param {ResourcePackWrapper} pack
|
|
4110
|
+
* @param {MeshConfigWrapper} config
|
|
4111
|
+
* @param {number} chunk_size
|
|
4112
|
+
* @returns {ChunkMeshResultWrapper}
|
|
4113
|
+
*/
|
|
4114
|
+
meshByChunkSize(pack, config, chunk_size) {
|
|
4115
|
+
_assertClass(pack, ResourcePackWrapper);
|
|
4116
|
+
_assertClass(config, MeshConfigWrapper);
|
|
4117
|
+
const ret = wasm.schematicwrapper_meshByChunkSize(this.__wbg_ptr, pack.__wbg_ptr, config.__wbg_ptr, chunk_size);
|
|
4118
|
+
if (ret[2]) {
|
|
4119
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
4120
|
+
}
|
|
4121
|
+
return ChunkMeshResultWrapper.__wrap(ret[0]);
|
|
4122
|
+
}
|
|
4123
|
+
/**
|
|
4124
|
+
* Create a lazy chunk mesh iterator.
|
|
4125
|
+
*
|
|
4126
|
+
* Call `advance()` to step to the next chunk, then `current()` to get the
|
|
4127
|
+
* mesh. Never loads the full world mesh into memory.
|
|
4128
|
+
* @param {ResourcePackWrapper} pack
|
|
4129
|
+
* @param {MeshConfigWrapper} config
|
|
4130
|
+
* @param {number} chunk_size
|
|
4131
|
+
* @returns {ChunkMeshIteratorWrapper}
|
|
4132
|
+
*/
|
|
4133
|
+
chunkMeshIterator(pack, config, chunk_size) {
|
|
4134
|
+
_assertClass(pack, ResourcePackWrapper);
|
|
4135
|
+
_assertClass(config, MeshConfigWrapper);
|
|
4136
|
+
const ret = wasm.schematicwrapper_chunkMeshIterator(this.__wbg_ptr, pack.__wbg_ptr, config.__wbg_ptr, chunk_size);
|
|
4137
|
+
return ChunkMeshIteratorWrapper.__wrap(ret);
|
|
4138
|
+
}
|
|
4139
|
+
/**
|
|
4140
|
+
* Register a mesh exporter with the FormatManager, enabling save_as("mesh", ...).
|
|
4141
|
+
* @param {ResourcePackWrapper} pack
|
|
4142
|
+
*/
|
|
4143
|
+
registerMeshExporter(pack) {
|
|
4144
|
+
_assertClass(pack, ResourcePackWrapper);
|
|
4145
|
+
const ret = wasm.schematicwrapper_registerMeshExporter(this.__wbg_ptr, pack.__wbg_ptr);
|
|
4146
|
+
if (ret[1]) {
|
|
4147
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
4148
|
+
}
|
|
4149
|
+
}
|
|
4150
|
+
/**
|
|
4151
|
+
* Create a lazy chunk mesh iterator that uses a pre-built global atlas.
|
|
4152
|
+
*
|
|
4153
|
+
* The global atlas is shared across all chunks, eliminating per-chunk atlas
|
|
4154
|
+
* duplication. Build the atlas first with `buildGlobalAtlas()`.
|
|
4155
|
+
* @param {ResourcePackWrapper} pack
|
|
4156
|
+
* @param {MeshConfigWrapper} config
|
|
4157
|
+
* @param {number} chunk_size
|
|
4158
|
+
* @param {TextureAtlasWrapper} atlas
|
|
4159
|
+
* @returns {ChunkMeshIteratorWrapper}
|
|
4160
|
+
*/
|
|
4161
|
+
chunkMeshIteratorWithAtlas(pack, config, chunk_size, atlas) {
|
|
4162
|
+
_assertClass(pack, ResourcePackWrapper);
|
|
4163
|
+
_assertClass(config, MeshConfigWrapper);
|
|
4164
|
+
_assertClass(atlas, TextureAtlasWrapper);
|
|
4165
|
+
const ret = wasm.schematicwrapper_chunkMeshIteratorWithAtlas(this.__wbg_ptr, pack.__wbg_ptr, config.__wbg_ptr, chunk_size, atlas.__wbg_ptr);
|
|
4166
|
+
return ChunkMeshIteratorWrapper.__wrap(ret);
|
|
4167
|
+
}
|
|
4168
|
+
/**
|
|
4169
|
+
* Generate a single mesh for the entire schematic.
|
|
4170
|
+
*
|
|
4171
|
+
* Returns a [`MeshOutputWrapper`] with per-layer typed arrays, atlas, and GLB data.
|
|
4172
|
+
* @param {ResourcePackWrapper} pack
|
|
4173
|
+
* @param {MeshConfigWrapper} config
|
|
4174
|
+
* @returns {MeshOutputWrapper}
|
|
4175
|
+
*/
|
|
4176
|
+
toMesh(pack, config) {
|
|
4177
|
+
_assertClass(pack, ResourcePackWrapper);
|
|
4178
|
+
_assertClass(config, MeshConfigWrapper);
|
|
4179
|
+
const ret = wasm.schematicwrapper_toMesh(this.__wbg_ptr, pack.__wbg_ptr, config.__wbg_ptr);
|
|
4180
|
+
if (ret[2]) {
|
|
4181
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
4182
|
+
}
|
|
4183
|
+
return MeshOutputWrapper.__wrap(ret[0]);
|
|
4184
|
+
}
|
|
4185
|
+
/**
|
|
4186
|
+
* Generate a USDZ mesh for the entire schematic.
|
|
4187
|
+
* @param {ResourcePackWrapper} pack
|
|
4188
|
+
* @param {MeshConfigWrapper} config
|
|
4189
|
+
* @returns {MeshOutputWrapper}
|
|
4190
|
+
*/
|
|
4191
|
+
toUsdz(pack, config) {
|
|
4192
|
+
_assertClass(pack, ResourcePackWrapper);
|
|
4193
|
+
_assertClass(config, MeshConfigWrapper);
|
|
4194
|
+
const ret = wasm.schematicwrapper_toUsdz(this.__wbg_ptr, pack.__wbg_ptr, config.__wbg_ptr);
|
|
4195
|
+
if (ret[2]) {
|
|
4196
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
4197
|
+
}
|
|
4198
|
+
return MeshOutputWrapper.__wrap(ret[0]);
|
|
4199
|
+
}
|
|
4200
|
+
/**
|
|
4201
|
+
* Creates a simulation world for this schematic with default options
|
|
4202
|
+
*
|
|
4203
|
+
* This allows you to simulate redstone circuits and interact with them.
|
|
4204
|
+
* @returns {MchprsWorldWrapper}
|
|
4205
|
+
*/
|
|
4206
|
+
create_simulation_world() {
|
|
4207
|
+
const ret = wasm.schematicwrapper_create_simulation_world(this.__wbg_ptr);
|
|
4208
|
+
if (ret[2]) {
|
|
4209
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
4210
|
+
}
|
|
4211
|
+
return MchprsWorldWrapper.__wrap(ret[0]);
|
|
4212
|
+
}
|
|
4213
|
+
/**
|
|
4214
|
+
* Creates a simulation world for this schematic with custom options
|
|
4215
|
+
*
|
|
4216
|
+
* This allows you to configure simulation behavior like wire state tracking.
|
|
4217
|
+
* @param {SimulationOptionsWrapper} options
|
|
4218
|
+
* @returns {MchprsWorldWrapper}
|
|
4219
|
+
*/
|
|
4220
|
+
create_simulation_world_with_options(options) {
|
|
4221
|
+
_assertClass(options, SimulationOptionsWrapper);
|
|
4222
|
+
const ret = wasm.schematicwrapper_create_simulation_world_with_options(this.__wbg_ptr, options.__wbg_ptr);
|
|
4223
|
+
if (ret[2]) {
|
|
4224
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
4225
|
+
}
|
|
4226
|
+
return MchprsWorldWrapper.__wrap(ret[0]);
|
|
4227
|
+
}
|
|
3919
4228
|
/**
|
|
3920
4229
|
* Add a mobile entity to the schematic.
|
|
3921
4230
|
* @param {string} id
|
|
@@ -4754,7 +5063,7 @@ export class SchematicWrapper {
|
|
|
4754
5063
|
* @returns {CircuitBuilderWrapper}
|
|
4755
5064
|
*/
|
|
4756
5065
|
createCircuitBuilder() {
|
|
4757
|
-
const ret = wasm.
|
|
5066
|
+
const ret = wasm.circuitbuilderwrapper_new(this.__wbg_ptr);
|
|
4758
5067
|
return CircuitBuilderWrapper.__wrap(ret);
|
|
4759
5068
|
}
|
|
4760
5069
|
/**
|
|
@@ -5250,205 +5559,6 @@ export class SchematicWrapper {
|
|
|
5250
5559
|
const len0 = WASM_VECTOR_LEN;
|
|
5251
5560
|
wasm.schematicwrapper_set_block(this.__wbg_ptr, x, y, z, ptr0, len0);
|
|
5252
5561
|
}
|
|
5253
|
-
/**
|
|
5254
|
-
* Creates a simulation world for this schematic with default options
|
|
5255
|
-
*
|
|
5256
|
-
* This allows you to simulate redstone circuits and interact with them.
|
|
5257
|
-
* @returns {MchprsWorldWrapper}
|
|
5258
|
-
*/
|
|
5259
|
-
create_simulation_world() {
|
|
5260
|
-
const ret = wasm.schematicwrapper_create_simulation_world(this.__wbg_ptr);
|
|
5261
|
-
if (ret[2]) {
|
|
5262
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
5263
|
-
}
|
|
5264
|
-
return MchprsWorldWrapper.__wrap(ret[0]);
|
|
5265
|
-
}
|
|
5266
|
-
/**
|
|
5267
|
-
* Creates a simulation world for this schematic with custom options
|
|
5268
|
-
*
|
|
5269
|
-
* This allows you to configure simulation behavior like wire state tracking.
|
|
5270
|
-
* @param {SimulationOptionsWrapper} options
|
|
5271
|
-
* @returns {MchprsWorldWrapper}
|
|
5272
|
-
*/
|
|
5273
|
-
create_simulation_world_with_options(options) {
|
|
5274
|
-
_assertClass(options, SimulationOptionsWrapper);
|
|
5275
|
-
const ret = wasm.schematicwrapper_create_simulation_world_with_options(this.__wbg_ptr, options.__wbg_ptr);
|
|
5276
|
-
if (ret[2]) {
|
|
5277
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
5278
|
-
}
|
|
5279
|
-
return MchprsWorldWrapper.__wrap(ret[0]);
|
|
5280
|
-
}
|
|
5281
|
-
/**
|
|
5282
|
-
* Generate raw mesh data for custom rendering pipelines.
|
|
5283
|
-
* @param {ResourcePackWrapper} pack
|
|
5284
|
-
* @param {MeshConfigWrapper} config
|
|
5285
|
-
* @returns {RawMeshExportWrapper}
|
|
5286
|
-
*/
|
|
5287
|
-
toRawMesh(pack, config) {
|
|
5288
|
-
_assertClass(pack, ResourcePackWrapper);
|
|
5289
|
-
_assertClass(config, MeshConfigWrapper);
|
|
5290
|
-
const ret = wasm.schematicwrapper_toRawMesh(this.__wbg_ptr, pack.__wbg_ptr, config.__wbg_ptr);
|
|
5291
|
-
if (ret[2]) {
|
|
5292
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
5293
|
-
}
|
|
5294
|
-
return RawMeshExportWrapper.__wrap(ret[0]);
|
|
5295
|
-
}
|
|
5296
|
-
/**
|
|
5297
|
-
* Generate one mesh per 16x16x16 chunk (eager, all at once).
|
|
5298
|
-
* @param {ResourcePackWrapper} pack
|
|
5299
|
-
* @param {MeshConfigWrapper} config
|
|
5300
|
-
* @returns {ChunkMeshResultWrapper}
|
|
5301
|
-
*/
|
|
5302
|
-
meshByChunk(pack, config) {
|
|
5303
|
-
_assertClass(pack, ResourcePackWrapper);
|
|
5304
|
-
_assertClass(config, MeshConfigWrapper);
|
|
5305
|
-
const ret = wasm.schematicwrapper_meshByChunk(this.__wbg_ptr, pack.__wbg_ptr, config.__wbg_ptr);
|
|
5306
|
-
if (ret[2]) {
|
|
5307
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
5308
|
-
}
|
|
5309
|
-
return ChunkMeshResultWrapper.__wrap(ret[0]);
|
|
5310
|
-
}
|
|
5311
|
-
/**
|
|
5312
|
-
* Generate a Minecraft item model using the plane-based approach.
|
|
5313
|
-
* @param {ResourcePackWrapper} pack
|
|
5314
|
-
* @param {ItemModelConfigWrapper} config
|
|
5315
|
-
* @returns {ItemModelResultWrapper}
|
|
5316
|
-
*/
|
|
5317
|
-
toItemModel(pack, config) {
|
|
5318
|
-
_assertClass(pack, ResourcePackWrapper);
|
|
5319
|
-
_assertClass(config, ItemModelConfigWrapper);
|
|
5320
|
-
const ret = wasm.schematicwrapper_toItemModel(this.__wbg_ptr, pack.__wbg_ptr, config.__wbg_ptr);
|
|
5321
|
-
if (ret[2]) {
|
|
5322
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
5323
|
-
}
|
|
5324
|
-
return ItemModelResultWrapper.__wrap(ret[0]);
|
|
5325
|
-
}
|
|
5326
|
-
/**
|
|
5327
|
-
* Generate one mesh per region.
|
|
5328
|
-
* @param {ResourcePackWrapper} pack
|
|
5329
|
-
* @param {MeshConfigWrapper} config
|
|
5330
|
-
* @returns {MultiMeshResultWrapper}
|
|
5331
|
-
*/
|
|
5332
|
-
meshByRegion(pack, config) {
|
|
5333
|
-
_assertClass(pack, ResourcePackWrapper);
|
|
5334
|
-
_assertClass(config, MeshConfigWrapper);
|
|
5335
|
-
const ret = wasm.schematicwrapper_meshByRegion(this.__wbg_ptr, pack.__wbg_ptr, config.__wbg_ptr);
|
|
5336
|
-
if (ret[2]) {
|
|
5337
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
5338
|
-
}
|
|
5339
|
-
return MultiMeshResultWrapper.__wrap(ret[0]);
|
|
5340
|
-
}
|
|
5341
|
-
/**
|
|
5342
|
-
* Build a single shared texture atlas from all unique block states.
|
|
5343
|
-
*
|
|
5344
|
-
* The atlas can be reused across all chunks via `chunkMeshIteratorWithAtlas()`,
|
|
5345
|
-
* eliminating per-chunk atlas duplication for massive schematics.
|
|
5346
|
-
* @param {ResourcePackWrapper} pack
|
|
5347
|
-
* @param {MeshConfigWrapper} config
|
|
5348
|
-
* @returns {TextureAtlasWrapper}
|
|
5349
|
-
*/
|
|
5350
|
-
buildGlobalAtlas(pack, config) {
|
|
5351
|
-
_assertClass(pack, ResourcePackWrapper);
|
|
5352
|
-
_assertClass(config, MeshConfigWrapper);
|
|
5353
|
-
const ret = wasm.schematicwrapper_buildGlobalAtlas(this.__wbg_ptr, pack.__wbg_ptr, config.__wbg_ptr);
|
|
5354
|
-
if (ret[2]) {
|
|
5355
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
5356
|
-
}
|
|
5357
|
-
return TextureAtlasWrapper.__wrap(ret[0]);
|
|
5358
|
-
}
|
|
5359
|
-
/**
|
|
5360
|
-
* Generate one mesh per chunk of the specified size (eager).
|
|
5361
|
-
* @param {ResourcePackWrapper} pack
|
|
5362
|
-
* @param {MeshConfigWrapper} config
|
|
5363
|
-
* @param {number} chunk_size
|
|
5364
|
-
* @returns {ChunkMeshResultWrapper}
|
|
5365
|
-
*/
|
|
5366
|
-
meshByChunkSize(pack, config, chunk_size) {
|
|
5367
|
-
_assertClass(pack, ResourcePackWrapper);
|
|
5368
|
-
_assertClass(config, MeshConfigWrapper);
|
|
5369
|
-
const ret = wasm.schematicwrapper_meshByChunkSize(this.__wbg_ptr, pack.__wbg_ptr, config.__wbg_ptr, chunk_size);
|
|
5370
|
-
if (ret[2]) {
|
|
5371
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
5372
|
-
}
|
|
5373
|
-
return ChunkMeshResultWrapper.__wrap(ret[0]);
|
|
5374
|
-
}
|
|
5375
|
-
/**
|
|
5376
|
-
* Create a lazy chunk mesh iterator.
|
|
5377
|
-
*
|
|
5378
|
-
* Call `advance()` to step to the next chunk, then `current()` to get the
|
|
5379
|
-
* mesh. Never loads the full world mesh into memory.
|
|
5380
|
-
* @param {ResourcePackWrapper} pack
|
|
5381
|
-
* @param {MeshConfigWrapper} config
|
|
5382
|
-
* @param {number} chunk_size
|
|
5383
|
-
* @returns {ChunkMeshIteratorWrapper}
|
|
5384
|
-
*/
|
|
5385
|
-
chunkMeshIterator(pack, config, chunk_size) {
|
|
5386
|
-
_assertClass(pack, ResourcePackWrapper);
|
|
5387
|
-
_assertClass(config, MeshConfigWrapper);
|
|
5388
|
-
const ret = wasm.schematicwrapper_chunkMeshIterator(this.__wbg_ptr, pack.__wbg_ptr, config.__wbg_ptr, chunk_size);
|
|
5389
|
-
return ChunkMeshIteratorWrapper.__wrap(ret);
|
|
5390
|
-
}
|
|
5391
|
-
/**
|
|
5392
|
-
* Register a mesh exporter with the FormatManager, enabling save_as("mesh", ...).
|
|
5393
|
-
* @param {ResourcePackWrapper} pack
|
|
5394
|
-
*/
|
|
5395
|
-
registerMeshExporter(pack) {
|
|
5396
|
-
_assertClass(pack, ResourcePackWrapper);
|
|
5397
|
-
const ret = wasm.schematicwrapper_registerMeshExporter(this.__wbg_ptr, pack.__wbg_ptr);
|
|
5398
|
-
if (ret[1]) {
|
|
5399
|
-
throw takeFromExternrefTable0(ret[0]);
|
|
5400
|
-
}
|
|
5401
|
-
}
|
|
5402
|
-
/**
|
|
5403
|
-
* Create a lazy chunk mesh iterator that uses a pre-built global atlas.
|
|
5404
|
-
*
|
|
5405
|
-
* The global atlas is shared across all chunks, eliminating per-chunk atlas
|
|
5406
|
-
* duplication. Build the atlas first with `buildGlobalAtlas()`.
|
|
5407
|
-
* @param {ResourcePackWrapper} pack
|
|
5408
|
-
* @param {MeshConfigWrapper} config
|
|
5409
|
-
* @param {number} chunk_size
|
|
5410
|
-
* @param {TextureAtlasWrapper} atlas
|
|
5411
|
-
* @returns {ChunkMeshIteratorWrapper}
|
|
5412
|
-
*/
|
|
5413
|
-
chunkMeshIteratorWithAtlas(pack, config, chunk_size, atlas) {
|
|
5414
|
-
_assertClass(pack, ResourcePackWrapper);
|
|
5415
|
-
_assertClass(config, MeshConfigWrapper);
|
|
5416
|
-
_assertClass(atlas, TextureAtlasWrapper);
|
|
5417
|
-
const ret = wasm.schematicwrapper_chunkMeshIteratorWithAtlas(this.__wbg_ptr, pack.__wbg_ptr, config.__wbg_ptr, chunk_size, atlas.__wbg_ptr);
|
|
5418
|
-
return ChunkMeshIteratorWrapper.__wrap(ret);
|
|
5419
|
-
}
|
|
5420
|
-
/**
|
|
5421
|
-
* Generate a single mesh for the entire schematic.
|
|
5422
|
-
*
|
|
5423
|
-
* Returns a [`MeshOutputWrapper`] with per-layer typed arrays, atlas, and GLB data.
|
|
5424
|
-
* @param {ResourcePackWrapper} pack
|
|
5425
|
-
* @param {MeshConfigWrapper} config
|
|
5426
|
-
* @returns {MeshOutputWrapper}
|
|
5427
|
-
*/
|
|
5428
|
-
toMesh(pack, config) {
|
|
5429
|
-
_assertClass(pack, ResourcePackWrapper);
|
|
5430
|
-
_assertClass(config, MeshConfigWrapper);
|
|
5431
|
-
const ret = wasm.schematicwrapper_toMesh(this.__wbg_ptr, pack.__wbg_ptr, config.__wbg_ptr);
|
|
5432
|
-
if (ret[2]) {
|
|
5433
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
5434
|
-
}
|
|
5435
|
-
return MeshOutputWrapper.__wrap(ret[0]);
|
|
5436
|
-
}
|
|
5437
|
-
/**
|
|
5438
|
-
* Generate a USDZ mesh for the entire schematic.
|
|
5439
|
-
* @param {ResourcePackWrapper} pack
|
|
5440
|
-
* @param {MeshConfigWrapper} config
|
|
5441
|
-
* @returns {MeshOutputWrapper}
|
|
5442
|
-
*/
|
|
5443
|
-
toUsdz(pack, config) {
|
|
5444
|
-
_assertClass(pack, ResourcePackWrapper);
|
|
5445
|
-
_assertClass(config, MeshConfigWrapper);
|
|
5446
|
-
const ret = wasm.schematicwrapper_toUsdz(this.__wbg_ptr, pack.__wbg_ptr, config.__wbg_ptr);
|
|
5447
|
-
if (ret[2]) {
|
|
5448
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
5449
|
-
}
|
|
5450
|
-
return MeshOutputWrapper.__wrap(ret[0]);
|
|
5451
|
-
}
|
|
5452
5562
|
}
|
|
5453
5563
|
if (Symbol.dispose) SchematicWrapper.prototype[Symbol.dispose] = SchematicWrapper.prototype.free;
|
|
5454
5564
|
|
|
@@ -6647,6 +6757,11 @@ function __wbg_get_imports() {
|
|
|
6647
6757
|
const ret = arg0 === null;
|
|
6648
6758
|
return ret;
|
|
6649
6759
|
};
|
|
6760
|
+
imports.wbg.__wbg___wbindgen_is_object_ce774f3490692386 = function(arg0) {
|
|
6761
|
+
const val = arg0;
|
|
6762
|
+
const ret = typeof(val) === 'object' && val !== null;
|
|
6763
|
+
return ret;
|
|
6764
|
+
};
|
|
6650
6765
|
imports.wbg.__wbg___wbindgen_is_string_704ef9c8fc131030 = function(arg0) {
|
|
6651
6766
|
const ret = typeof(arg0) === 'string';
|
|
6652
6767
|
return ret;
|