@orusteam/solariscore 2.5.13 → 2.5.15
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/dist/block/components/LeavesBlockComponent.d.ts.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +22 -16
- package/dist/utils/ChunkUtil.d.ts +1 -1
- package/dist/utils/ChunkUtil.d.ts.map +1 -1
- package/dist/utils/ColorUtil.d.ts +7 -1
- package/dist/utils/ColorUtil.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/block/components/GrassDecayBlockComponent.d.ts +0 -6
- package/dist/block/components/GrassDecayBlockComponent.d.ts.map +0 -1
- package/dist/registry/BlockComponentRegistry.d.ts +0 -2
- package/dist/registry/BlockComponentRegistry.d.ts.map +0 -1
- package/dist/registry/index.d.ts +0 -2
- package/dist/registry/index.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LeavesBlockComponent.d.ts","sourceRoot":"","sources":["../../../src/block/components/LeavesBlockComponent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,oBAAoB,EAAE,yBAAyB,EAA4B,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"LeavesBlockComponent.d.ts","sourceRoot":"","sources":["../../../src/block/components/LeavesBlockComponent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,oBAAoB,EAAE,yBAAyB,EAA4B,MAAM,mBAAmB,CAAC;AAW7I,qBAAa,oBAAqB,YAAW,oBAAoB;;IAK7D,YAAY,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,6BAA6B,EAAE,EAAE,MAAM,EAAE,EAAE,yBAAyB;CAwB1G"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export * from "./block/components";
|
|
2
|
-
export * from "./item/components";
|
|
3
1
|
export * from "./misc/DynamicDatabase";
|
|
4
2
|
export * from "./utils";
|
|
5
3
|
type SolarisCoreBlockComponentIds = "solariscore:crop" | "solariscore:door" | "solariscore:egg" | "solariscore:grass" | "solariscore:leaves" | "solariscore:particle_emitter" | "solariscore:sapling";
|
|
4
|
+
type SolarisCoreItemComponentIds = "solariscore:durability_sensor";
|
|
6
5
|
declare class SolarisCore {
|
|
7
6
|
setEnabledBlockComponents(componentIds: SolarisCoreBlockComponentIds[]): void;
|
|
7
|
+
setEnabledItemComponents(componentIds: SolarisCoreItemComponentIds[]): void;
|
|
8
8
|
}
|
|
9
9
|
export declare const solarisCore: SolarisCore;
|
|
10
10
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,cAAc,wBAAwB,CAAC;AACvC,cAAc,SAAS,CAAC;AAIxB,KAAK,4BAA4B,GAC3B,kBAAkB,GAClB,kBAAkB,GAClB,iBAAiB,GACjB,mBAAmB,GACnB,oBAAoB,GACpB,8BAA8B,GAC9B,qBAAqB,CAAC;AAC5B,KAAK,2BAA2B,GAC1B,+BAA+B,CAAC;AAoBtC,cAAM,WAAW;IACb,yBAAyB,CAAC,YAAY,EAAE,4BAA4B,EAAE;IAStE,wBAAwB,CAAC,YAAY,EAAE,2BAA2B,EAAE;CASvE;AAID,eAAO,MAAM,WAAW,aAAoB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -591,6 +591,13 @@ var ColorUtil = class {
|
|
|
591
591
|
blue: result ? parseInt(result[3], 16) / 255 : 0
|
|
592
592
|
};
|
|
593
593
|
}
|
|
594
|
+
static normalize(rgbInt) {
|
|
595
|
+
return {
|
|
596
|
+
red: rgbInt.red / 255,
|
|
597
|
+
green: rgbInt.green / 255,
|
|
598
|
+
blue: rgbInt.blue / 255
|
|
599
|
+
};
|
|
600
|
+
}
|
|
594
601
|
static rgbToTuple(rgb) {
|
|
595
602
|
return [rgb.red, rgb.green, rgb.blue];
|
|
596
603
|
}
|
|
@@ -4451,11 +4458,7 @@ var LeavesBlockComponent = class {
|
|
|
4451
4458
|
if (blockBelow.isAir) {
|
|
4452
4459
|
const { color } = params;
|
|
4453
4460
|
const molangVariableMap = new MolangVariableMap();
|
|
4454
|
-
molangVariableMap.setColorRGB("color",
|
|
4455
|
-
red: color[0],
|
|
4456
|
-
green: color[1],
|
|
4457
|
-
blue: color[2]
|
|
4458
|
-
});
|
|
4461
|
+
if (color) molangVariableMap.setColorRGB("color", ColorUtil.colorToRgb(color));
|
|
4459
4462
|
dimension.spawnParticle("minecraft:biome_tinted_leaves_particle", block.center(), molangVariableMap);
|
|
4460
4463
|
}
|
|
4461
4464
|
}
|
|
@@ -4641,7 +4644,7 @@ function getDynamicDatabase(provider, dataId) {
|
|
|
4641
4644
|
}
|
|
4642
4645
|
|
|
4643
4646
|
// src/index.ts
|
|
4644
|
-
var
|
|
4647
|
+
var solarisCoreBlockComponentClassMap = {
|
|
4645
4648
|
"solariscore:crop": CropBlockComponent,
|
|
4646
4649
|
"solariscore:door": DoorBlockComponent,
|
|
4647
4650
|
"solariscore:egg": EggBlockComponent,
|
|
@@ -4650,16 +4653,28 @@ var SolarisCoreBlockComponentClassMap = {
|
|
|
4650
4653
|
"solariscore:particle_emitter": ParticleEmitterBlockComponent,
|
|
4651
4654
|
"solariscore:sapling": SaplingBlockComponent
|
|
4652
4655
|
};
|
|
4656
|
+
var solarisCoreItemComponentClassMap = {
|
|
4657
|
+
"solariscore:durability_sensor": DurabilitySensorItemComponent
|
|
4658
|
+
};
|
|
4653
4659
|
var SolarisCore = class {
|
|
4654
4660
|
setEnabledBlockComponents(componentIds) {
|
|
4655
4661
|
system6.beforeEvents.startup.subscribe(({ blockComponentRegistry }) => {
|
|
4656
4662
|
for (const id of componentIds) {
|
|
4657
|
-
const ComponentClass =
|
|
4663
|
+
const ComponentClass = solarisCoreBlockComponentClassMap[id];
|
|
4658
4664
|
if (!ComponentClass) continue;
|
|
4659
4665
|
blockComponentRegistry.registerCustomComponent(id, new ComponentClass());
|
|
4660
4666
|
}
|
|
4661
4667
|
});
|
|
4662
4668
|
}
|
|
4669
|
+
setEnabledItemComponents(componentIds) {
|
|
4670
|
+
system6.beforeEvents.startup.subscribe(({ itemComponentRegistry }) => {
|
|
4671
|
+
for (const id of componentIds) {
|
|
4672
|
+
const ComponentClass = solarisCoreItemComponentClassMap[id];
|
|
4673
|
+
if (!ComponentClass) continue;
|
|
4674
|
+
itemComponentRegistry.registerCustomComponent(id, new ComponentClass());
|
|
4675
|
+
}
|
|
4676
|
+
});
|
|
4677
|
+
}
|
|
4663
4678
|
};
|
|
4664
4679
|
var solarisCore = new SolarisCore();
|
|
4665
4680
|
export {
|
|
@@ -4668,24 +4683,15 @@ export {
|
|
|
4668
4683
|
ChunkManager,
|
|
4669
4684
|
ChunkUtil,
|
|
4670
4685
|
ColorUtil,
|
|
4671
|
-
CropBlockComponent,
|
|
4672
4686
|
DateUtil,
|
|
4673
|
-
DoorBlockComponent,
|
|
4674
|
-
DurabilitySensorItemComponent,
|
|
4675
4687
|
DynamicDatabase,
|
|
4676
|
-
EggBlockComponent,
|
|
4677
4688
|
EntityUtil,
|
|
4678
|
-
GrassBlockComponent,
|
|
4679
4689
|
ItemUtil,
|
|
4680
|
-
LeavesBlockComponent,
|
|
4681
4690
|
MathUtil,
|
|
4682
4691
|
MessageUtil,
|
|
4683
|
-
ParticleEmitterBlockComponent,
|
|
4684
|
-
SaplingBlockComponent,
|
|
4685
4692
|
StringUtil,
|
|
4686
4693
|
VectorUtil,
|
|
4687
4694
|
WorldUtil,
|
|
4688
|
-
applyGrowthEffects,
|
|
4689
4695
|
getDynamicDatabase,
|
|
4690
4696
|
solarisCore
|
|
4691
4697
|
};
|
|
@@ -10,7 +10,7 @@ declare class ChunkManager {
|
|
|
10
10
|
}
|
|
11
11
|
declare class ChunkUtil {
|
|
12
12
|
private static chunksCache;
|
|
13
|
-
static getChunk(dimension: Dimension, location: VectorXZ): ChunkManager
|
|
13
|
+
static getChunk(dimension: Dimension, location: VectorXZ): ChunkManager;
|
|
14
14
|
static getChunkId(location: VectorXZ): string;
|
|
15
15
|
static getChunkXZ(location: VectorXZ): VectorXZ;
|
|
16
16
|
static getNearbyChunks(dimension: Dimension, location: Vector3, renderDistance?: number): ChunkManager[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChunkUtil.d.ts","sourceRoot":"","sources":["../../src/utils/ChunkUtil.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAU,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAIzE,cAAM,YAAY;IAMF,QAAQ,CAAC,SAAS,EAAE,SAAS;IALzC,QAAQ,CAAC,WAAW,EAAE,QAAQ,CAAC;IAC/B,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC;IAC3B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,OAAO,CAAS;gBAER,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ;IAS7D,IAAI,QAAQ,IAAI,OAAO,CAEtB;CACJ;AAID,cAAM,SAAS;IACX,OAAO,CAAC,MAAM,CAAC,WAAW,CAAmC;IAE7D,MAAM,CAAC,QAAQ,CAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,GAAG,YAAY
|
|
1
|
+
{"version":3,"file":"ChunkUtil.d.ts","sourceRoot":"","sources":["../../src/utils/ChunkUtil.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAU,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAIzE,cAAM,YAAY;IAMF,QAAQ,CAAC,SAAS,EAAE,SAAS;IALzC,QAAQ,CAAC,WAAW,EAAE,QAAQ,CAAC;IAC/B,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC;IAC3B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,OAAO,CAAS;gBAER,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ;IAS7D,IAAI,QAAQ,IAAI,OAAO,CAEtB;CACJ;AAID,cAAM,SAAS;IACX,OAAO,CAAC,MAAM,CAAC,WAAW,CAAmC;IAE7D,MAAM,CAAC,QAAQ,CAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,GAAG,YAAY;IAavE,MAAM,CAAC,UAAU,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM;IAK7C,MAAM,CAAC,UAAU,CAAC,QAAQ,EAAE,QAAQ,GAAG,QAAQ;IAO/C,MAAM,CAAC,eAAe,CAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,cAAc,GAAE,MAAU;WA6B7E,gBAAgB,CAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;CAWxF;AAID,OAAO,EACH,YAAY,EACZ,SAAS,EACZ,CAAC"}
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import { RGB } from "@minecraft/server";
|
|
2
|
-
|
|
2
|
+
interface RGBInt {
|
|
3
|
+
red: number;
|
|
4
|
+
green: number;
|
|
5
|
+
blue: number;
|
|
6
|
+
}
|
|
7
|
+
type RGBTuple = [red: number, green: number, blue: number];
|
|
3
8
|
type Color = RGB | RGBTuple | string;
|
|
4
9
|
declare class ColorUtil {
|
|
5
10
|
static colorToRgb(color: Color): RGB;
|
|
6
11
|
static hexToRgb(hex: string): RGB;
|
|
12
|
+
static normalize(rgbInt: RGBInt): RGB;
|
|
7
13
|
static rgbToTuple(rgb: RGB): RGBTuple;
|
|
8
14
|
static tupleToRgb(tuple: RGBTuple): RGB;
|
|
9
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorUtil.d.ts","sourceRoot":"","sources":["../../src/utils/ColorUtil.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAIxC,KAAK,QAAQ,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"ColorUtil.d.ts","sourceRoot":"","sources":["../../src/utils/ColorUtil.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAIxC,UAAU,MAAM;IAAG,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;CAAE;AAC9D,KAAK,QAAQ,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;AAC3D,KAAK,KAAK,GAAG,GAAG,GAAG,QAAQ,GAAG,MAAM,CAAC;AAIrC,cAAM,SAAS;IACX,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,KAAK,GAAG,GAAG;IAYpC,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG;IASjC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG;IAQrC,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,GAAG,QAAQ;IAIrC,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,QAAQ,GAAG,GAAG;CAO1C;AAID,OAAO,EACH,KAAK,EACL,SAAS,EACT,QAAQ,EACX,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orusteam/solariscore",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.15",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
],
|
|
10
10
|
"peerDependencies": {
|
|
11
11
|
"@minecraft/math": "^2.4.0",
|
|
12
|
-
"@minecraft/server": "^2.
|
|
12
|
+
"@minecraft/server": "^2.6.0",
|
|
13
13
|
"@minecraft/server-ui": "^2.0.0"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { BlockComponentRandomTickEvent, BlockCustomComponent, CustomComponentParameters } from "@minecraft/server";
|
|
2
|
-
export declare class GrassBlockComponent implements BlockCustomComponent {
|
|
3
|
-
constructor();
|
|
4
|
-
onRandomTick({ block }: BlockComponentRandomTickEvent, { params }: CustomComponentParameters): void;
|
|
5
|
-
}
|
|
6
|
-
//# sourceMappingURL=GrassDecayBlockComponent.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GrassDecayBlockComponent.d.ts","sourceRoot":"","sources":["../../../src/block/components/GrassDecayBlockComponent.ts"],"names":[],"mappings":"AACA,OAAO,EAAS,6BAA6B,EAAE,oBAAoB,EAAE,yBAAyB,EAAW,MAAM,mBAAmB,CAAC;AAkCnI,qBAAa,mBAAoB,YAAW,oBAAoB;;IAK5D,YAAY,CAAC,EAAE,KAAK,EAAE,EAAE,6BAA6B,EAAE,EAAE,MAAM,EAAE,EAAE,yBAAyB;CAS/F"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BlockComponentRegistry.d.ts","sourceRoot":"","sources":["../../src/registry/BlockComponentRegistry.ts"],"names":[],"mappings":""}
|
package/dist/registry/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/registry/index.ts"],"names":[],"mappings":"AAAA,OAAO,0BAA0B,CAAC"}
|