@orusteam/solariscore 2.5.0 → 2.5.1
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/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +122 -69
- package/dist/item/components/index.d.ts +2 -0
- package/dist/item/components/index.d.ts.map +1 -0
- package/dist/tests/playerGroup/PlayerGroup.d.ts +1 -0
- package/dist/tests/playerGroup/PlayerGroup.d.ts.map +1 -0
- package/dist/tests/playerGroup/groupCommands.d.ts +1 -0
- package/dist/tests/playerGroup/groupCommands.d.ts.map +1 -0
- package/dist/utils/ChunkUtil.d.ts +19 -0
- package/dist/utils/ChunkUtil.d.ts.map +1 -0
- package/dist/utils/WorldUtil.d.ts +0 -2
- package/dist/utils/WorldUtil.d.ts.map +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,SAAS,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -461,7 +461,7 @@
|
|
|
461
461
|
var import_server = __require("@minecraft/server");
|
|
462
462
|
|
|
463
463
|
// src/block/components/CropBlockComponent.ts
|
|
464
|
-
var
|
|
464
|
+
var import_server7 = __require("@minecraft/server");
|
|
465
465
|
|
|
466
466
|
// src/utils/BlockBuilder.ts
|
|
467
467
|
var BlockBuilder = class {
|
|
@@ -503,6 +503,61 @@
|
|
|
503
503
|
}
|
|
504
504
|
};
|
|
505
505
|
|
|
506
|
+
// src/utils/ChunkUtil.ts
|
|
507
|
+
var import_server2 = __require("@minecraft/server");
|
|
508
|
+
var ChunkManager = class {
|
|
509
|
+
constructor(dimension, location) {
|
|
510
|
+
this.dimension = dimension;
|
|
511
|
+
this.id = ChunkUtil.getChunkId(location);
|
|
512
|
+
this.chunkXZ = ChunkUtil.getChunkXZ(location);
|
|
513
|
+
this.chunkOrigin = {
|
|
514
|
+
x: this.chunkXZ.x * 16,
|
|
515
|
+
z: this.chunkXZ.z * 16
|
|
516
|
+
};
|
|
517
|
+
}
|
|
518
|
+
chunkOrigin;
|
|
519
|
+
chunkXZ;
|
|
520
|
+
id;
|
|
521
|
+
isGenerated = false;
|
|
522
|
+
get isLoaded() {
|
|
523
|
+
return this.dimension.isChunkLoaded(new Vector3Builder(this.chunkOrigin.x, 0, this.chunkOrigin.z));
|
|
524
|
+
}
|
|
525
|
+
};
|
|
526
|
+
var ChunkUtil = class {
|
|
527
|
+
static chunksCache = /* @__PURE__ */ new Map();
|
|
528
|
+
static getChunk(dimension, location) {
|
|
529
|
+
const chunkId = this.getChunkId(location);
|
|
530
|
+
const chunk = this.chunksCache.get(chunkId);
|
|
531
|
+
if (chunk) {
|
|
532
|
+
return chunk;
|
|
533
|
+
}
|
|
534
|
+
const newChunk = new ChunkManager(dimension, location);
|
|
535
|
+
this.chunksCache.set(chunkId, newChunk);
|
|
536
|
+
return newChunk;
|
|
537
|
+
}
|
|
538
|
+
static getChunkId(location) {
|
|
539
|
+
const chunkXZ = this.getChunkXZ(location);
|
|
540
|
+
return `${chunkXZ.x}.${chunkXZ.z}`;
|
|
541
|
+
}
|
|
542
|
+
static getChunkXZ(location) {
|
|
543
|
+
return {
|
|
544
|
+
x: Math.floor(location.x / 16),
|
|
545
|
+
z: Math.floor(location.z / 16)
|
|
546
|
+
};
|
|
547
|
+
}
|
|
548
|
+
static async waitForChunkLoad(dimension, location) {
|
|
549
|
+
return new Promise((resolve) => {
|
|
550
|
+
const runId = import_server2.system.runInterval(async () => {
|
|
551
|
+
if (dimension.isChunkLoaded(location)) {
|
|
552
|
+
import_server2.system.clearRun(runId);
|
|
553
|
+
await import_server2.system.waitTicks(20);
|
|
554
|
+
resolve();
|
|
555
|
+
}
|
|
556
|
+
});
|
|
557
|
+
});
|
|
558
|
+
}
|
|
559
|
+
};
|
|
560
|
+
|
|
506
561
|
// src/utils/ColorUtil.ts
|
|
507
562
|
var ColorUtil = class {
|
|
508
563
|
static hexToRgb(hex) {
|
|
@@ -580,7 +635,7 @@
|
|
|
580
635
|
};
|
|
581
636
|
|
|
582
637
|
// src/utils/ItemUtil.ts
|
|
583
|
-
var
|
|
638
|
+
var import_server3 = __require("@minecraft/server");
|
|
584
639
|
|
|
585
640
|
// src/utils/MathUtil.ts
|
|
586
641
|
var MathUtil = class {
|
|
@@ -625,10 +680,10 @@
|
|
|
625
680
|
];
|
|
626
681
|
var ItemUtil = class {
|
|
627
682
|
static decrementStack(entity) {
|
|
628
|
-
if (entity instanceof
|
|
683
|
+
if (entity instanceof import_server3.Player && entity.getGameMode() === import_server3.GameMode.Creative) return;
|
|
629
684
|
const equippableComponent = entity.getComponent("minecraft:equippable");
|
|
630
685
|
if (equippableComponent) {
|
|
631
|
-
const mainhand = equippableComponent.getEquipmentSlot(
|
|
686
|
+
const mainhand = equippableComponent.getEquipmentSlot(import_server3.EquipmentSlot.Mainhand);
|
|
632
687
|
if (mainhand.hasItem()) {
|
|
633
688
|
if (mainhand.amount > 1) mainhand.amount--;
|
|
634
689
|
else mainhand.setItem(void 0);
|
|
@@ -668,11 +723,11 @@
|
|
|
668
723
|
const { container } = inventoryComponent;
|
|
669
724
|
if (container) {
|
|
670
725
|
for (let index = 0; index < itemIds.length; index++) {
|
|
671
|
-
const itemStack = new
|
|
726
|
+
const itemStack = new import_server3.ItemStack(itemIds[index]);
|
|
672
727
|
const slotIndex = 8 - index;
|
|
673
728
|
if (container.getItem(slotIndex)?.typeId !== itemStack.typeId) {
|
|
674
729
|
itemStack.keepOnDeath = true;
|
|
675
|
-
itemStack.lockMode =
|
|
730
|
+
itemStack.lockMode = import_server3.ItemLockMode.slot;
|
|
676
731
|
container.setItem(slotIndex, itemStack);
|
|
677
732
|
}
|
|
678
733
|
}
|
|
@@ -680,11 +735,11 @@
|
|
|
680
735
|
}
|
|
681
736
|
}
|
|
682
737
|
static tryDamageHeldItem(source, amount) {
|
|
683
|
-
if (source instanceof
|
|
738
|
+
if (source instanceof import_server3.Player && source.getGameMode() === import_server3.GameMode.Creative) {
|
|
684
739
|
return false;
|
|
685
740
|
}
|
|
686
741
|
const equippableComponent = source.getComponent("minecraft:equippable");
|
|
687
|
-
const itemStack = equippableComponent?.getEquipment(
|
|
742
|
+
const itemStack = equippableComponent?.getEquipment(import_server3.EquipmentSlot.Mainhand);
|
|
688
743
|
if (equippableComponent && itemStack) {
|
|
689
744
|
const durability = itemStack.getComponent("minecraft:durability");
|
|
690
745
|
if (durability) {
|
|
@@ -696,10 +751,10 @@
|
|
|
696
751
|
}
|
|
697
752
|
}
|
|
698
753
|
if (durability.damage >= durability.maxDurability) {
|
|
699
|
-
equippableComponent.setEquipment(
|
|
754
|
+
equippableComponent.setEquipment(import_server3.EquipmentSlot.Mainhand);
|
|
700
755
|
source.dimension.playSound("random.break", source.location);
|
|
701
756
|
} else {
|
|
702
|
-
equippableComponent.setEquipment(
|
|
757
|
+
equippableComponent.setEquipment(import_server3.EquipmentSlot.Mainhand, itemStack);
|
|
703
758
|
}
|
|
704
759
|
return true;
|
|
705
760
|
}
|
|
@@ -709,17 +764,17 @@
|
|
|
709
764
|
};
|
|
710
765
|
|
|
711
766
|
// src/utils/MessageUtil.ts
|
|
712
|
-
var
|
|
767
|
+
var import_server4 = __require("@minecraft/server");
|
|
713
768
|
var MessageUtil = class {
|
|
714
769
|
static async sendSequence(source, messages, options) {
|
|
715
770
|
const { delayBetweenMessages, popSound } = options;
|
|
716
771
|
for (const message of messages) {
|
|
717
772
|
source.sendMessage(message);
|
|
718
|
-
if (popSound && source instanceof
|
|
773
|
+
if (popSound && source instanceof import_server4.Player) {
|
|
719
774
|
source.playSound(popSound);
|
|
720
775
|
}
|
|
721
776
|
if (delayBetweenMessages) {
|
|
722
|
-
await
|
|
777
|
+
await import_server4.system.waitTicks(delayBetweenMessages);
|
|
723
778
|
}
|
|
724
779
|
}
|
|
725
780
|
}
|
|
@@ -735,7 +790,7 @@
|
|
|
735
790
|
};
|
|
736
791
|
|
|
737
792
|
// src/utils/VectorUtil.ts
|
|
738
|
-
var
|
|
793
|
+
var import_server5 = __require("@minecraft/server");
|
|
739
794
|
var VectorUtil = class {
|
|
740
795
|
static cubicInterpolate(p0, p1, p2, p3, t) {
|
|
741
796
|
return {
|
|
@@ -746,19 +801,19 @@
|
|
|
746
801
|
}
|
|
747
802
|
static faceToVector(face) {
|
|
748
803
|
const map = {
|
|
749
|
-
[
|
|
750
|
-
[
|
|
751
|
-
[
|
|
752
|
-
[
|
|
753
|
-
[
|
|
754
|
-
[
|
|
804
|
+
[import_server5.Direction.Down]: new Vector3Builder(0, -1, 0),
|
|
805
|
+
[import_server5.Direction.Up]: new Vector3Builder(0, 1, 0),
|
|
806
|
+
[import_server5.Direction.South]: new Vector3Builder(0, 0, 1),
|
|
807
|
+
[import_server5.Direction.North]: new Vector3Builder(0, 0, -1),
|
|
808
|
+
[import_server5.Direction.East]: new Vector3Builder(1, 0, 0),
|
|
809
|
+
[import_server5.Direction.West]: new Vector3Builder(-1, 0, 0)
|
|
755
810
|
};
|
|
756
811
|
return map[face] ?? new Vector3Builder(0, 0, 0);
|
|
757
812
|
}
|
|
758
813
|
};
|
|
759
814
|
|
|
760
815
|
// src/utils/WorldUtil.ts
|
|
761
|
-
var
|
|
816
|
+
var import_server6 = __require("@minecraft/server");
|
|
762
817
|
|
|
763
818
|
// node_modules/@minecraft/vanilla-data/lib/index.js
|
|
764
819
|
var MinecraftBiomeTypes = ((MinecraftBiomeTypes2) => {
|
|
@@ -3971,9 +4026,9 @@
|
|
|
3971
4026
|
var WorldUtil = class {
|
|
3972
4027
|
static get dimensions() {
|
|
3973
4028
|
return {
|
|
3974
|
-
nether:
|
|
3975
|
-
overworld:
|
|
3976
|
-
theEnd:
|
|
4029
|
+
nether: import_server6.world.getDimension(MinecraftDimensionTypes.Nether),
|
|
4030
|
+
overworld: import_server6.world.getDimension(MinecraftDimensionTypes.Overworld),
|
|
4031
|
+
theEnd: import_server6.world.getDimension(MinecraftDimensionTypes.TheEnd)
|
|
3977
4032
|
};
|
|
3978
4033
|
}
|
|
3979
4034
|
static applyAreaDamage(dimension, location, radius, amount, options) {
|
|
@@ -3995,13 +4050,13 @@
|
|
|
3995
4050
|
return affectedEntities;
|
|
3996
4051
|
}
|
|
3997
4052
|
static getTimeOfDay() {
|
|
3998
|
-
const currentTime =
|
|
3999
|
-
if (currentTime >=
|
|
4000
|
-
if (currentTime >=
|
|
4001
|
-
if (currentTime >=
|
|
4002
|
-
if (currentTime >=
|
|
4003
|
-
if (currentTime >=
|
|
4004
|
-
if (currentTime >=
|
|
4053
|
+
const currentTime = import_server6.world.getTimeOfDay();
|
|
4054
|
+
if (currentTime >= import_server6.TimeOfDay.Sunrise || currentTime < import_server6.TimeOfDay.Day) return "Sunrise";
|
|
4055
|
+
if (currentTime >= import_server6.TimeOfDay.Day && currentTime < import_server6.TimeOfDay.Noon) return "Day";
|
|
4056
|
+
if (currentTime >= import_server6.TimeOfDay.Noon && currentTime < import_server6.TimeOfDay.Sunset) return "Noon";
|
|
4057
|
+
if (currentTime >= import_server6.TimeOfDay.Sunset && currentTime < import_server6.TimeOfDay.Night) return "Sunset";
|
|
4058
|
+
if (currentTime >= import_server6.TimeOfDay.Night && currentTime < import_server6.TimeOfDay.Midnight) return "Night";
|
|
4059
|
+
if (currentTime >= import_server6.TimeOfDay.Midnight && currentTime < import_server6.TimeOfDay.Sunrise) return "Midnight";
|
|
4005
4060
|
}
|
|
4006
4061
|
static isValidSpawnLocation(dimension, location) {
|
|
4007
4062
|
let block;
|
|
@@ -4024,22 +4079,6 @@
|
|
|
4024
4079
|
}
|
|
4025
4080
|
return true;
|
|
4026
4081
|
}
|
|
4027
|
-
static spawnIndicator(dimension, location, text) {
|
|
4028
|
-
const indicator = dimension.spawnEntity("dbe:damage_indicator", location);
|
|
4029
|
-
indicator.nameTag = text;
|
|
4030
|
-
indicator.applyImpulse(new Vector3Builder(MathUtil.random(0, 0.01), 0.05, MathUtil.random(0, 0.01)));
|
|
4031
|
-
}
|
|
4032
|
-
static async waitForChunkLoad(dimension, location) {
|
|
4033
|
-
return new Promise((resolve) => {
|
|
4034
|
-
const runId = import_server5.system.runInterval(async () => {
|
|
4035
|
-
if (dimension.isChunkLoaded(location)) {
|
|
4036
|
-
import_server5.system.clearRun(runId);
|
|
4037
|
-
await import_server5.system.waitTicks(20);
|
|
4038
|
-
resolve();
|
|
4039
|
-
}
|
|
4040
|
-
});
|
|
4041
|
-
});
|
|
4042
|
-
}
|
|
4043
4082
|
};
|
|
4044
4083
|
|
|
4045
4084
|
// src/block/components/CropBlockComponent.ts
|
|
@@ -4063,7 +4102,7 @@
|
|
|
4063
4102
|
}
|
|
4064
4103
|
onPlayerInteract({ block, dimension, player }, { params }) {
|
|
4065
4104
|
if (!player) return;
|
|
4066
|
-
const mainhand = EntityUtil.getEquippedItem(player,
|
|
4105
|
+
const mainhand = EntityUtil.getEquippedItem(player, import_server7.EquipmentSlot.Mainhand);
|
|
4067
4106
|
if (!mainhand) return;
|
|
4068
4107
|
const { permutation } = block;
|
|
4069
4108
|
const { accumulable, bone_meal_multiplication, max_stage } = params;
|
|
@@ -4077,10 +4116,10 @@
|
|
|
4077
4116
|
return;
|
|
4078
4117
|
}
|
|
4079
4118
|
if (typeId !== "minecraft:bone_meal") return;
|
|
4080
|
-
const isCreative = player.getGameMode() ===
|
|
4119
|
+
const isCreative = player.getGameMode() === import_server7.GameMode.Creative;
|
|
4081
4120
|
const fullyGrown = growthStage >= max_stage;
|
|
4082
4121
|
if (bone_meal_multiplication && fullyGrown) {
|
|
4083
|
-
dimension.spawnItem(new
|
|
4122
|
+
dimension.spawnItem(new import_server7.ItemStack(block.typeId), location);
|
|
4084
4123
|
ItemUtil.decrementStack(player);
|
|
4085
4124
|
applyGrowthEffects(block);
|
|
4086
4125
|
return;
|
|
@@ -4108,7 +4147,7 @@
|
|
|
4108
4147
|
};
|
|
4109
4148
|
|
|
4110
4149
|
// src/block/components/DoorBlockComponent.ts
|
|
4111
|
-
var
|
|
4150
|
+
var import_server8 = __require("@minecraft/server");
|
|
4112
4151
|
function doorIsOpen(block) {
|
|
4113
4152
|
const allStates = block.permutation.getAllStates();
|
|
4114
4153
|
return Boolean(allStates["dbe:open_bit"]);
|
|
@@ -4174,9 +4213,9 @@
|
|
|
4174
4213
|
if (!block.below()?.isAir && block.typeId === aboveBlock?.typeId) {
|
|
4175
4214
|
const upperBlockStates = { ...allStates };
|
|
4176
4215
|
upperBlockStates["dbe:upper_block_bit"] = true;
|
|
4177
|
-
const upperBlockPermutation =
|
|
4178
|
-
event.permutationToPlace =
|
|
4179
|
-
|
|
4216
|
+
const upperBlockPermutation = import_server8.BlockPermutation.resolve(permutationToPlace.type.id, upperBlockStates);
|
|
4217
|
+
event.permutationToPlace = import_server8.BlockPermutation.resolve(permutationToPlace.type.id, allStates);
|
|
4218
|
+
import_server8.system.run(() => {
|
|
4180
4219
|
aboveBlock.setType(permutationToPlace.type.id);
|
|
4181
4220
|
aboveBlock.setPermutation(upperBlockPermutation);
|
|
4182
4221
|
});
|
|
@@ -4203,9 +4242,9 @@
|
|
|
4203
4242
|
};
|
|
4204
4243
|
|
|
4205
4244
|
// src/block/components/EggBlockComponent.ts
|
|
4206
|
-
var
|
|
4245
|
+
var import_server9 = __require("@minecraft/server");
|
|
4207
4246
|
function canCrack() {
|
|
4208
|
-
const timeOfDay =
|
|
4247
|
+
const timeOfDay = import_server9.world.getTimeOfDay();
|
|
4209
4248
|
if (timeOfDay >= 21600 && timeOfDay <= 22550) return true;
|
|
4210
4249
|
return Math.random() < 2e-3;
|
|
4211
4250
|
}
|
|
@@ -4263,7 +4302,7 @@
|
|
|
4263
4302
|
};
|
|
4264
4303
|
|
|
4265
4304
|
// src/block/components/LeavesBlockComponent.ts
|
|
4266
|
-
var
|
|
4305
|
+
var import_server10 = __require("@minecraft/server");
|
|
4267
4306
|
var LeavesBlockComponent = class {
|
|
4268
4307
|
constructor() {
|
|
4269
4308
|
this.onRandomTick = this.onRandomTick.bind(this);
|
|
@@ -4271,7 +4310,7 @@
|
|
|
4271
4310
|
onRandomTick({ block, dimension }, { params }) {
|
|
4272
4311
|
const shouldDecay = false;
|
|
4273
4312
|
if (shouldDecay) {
|
|
4274
|
-
const blockLoot =
|
|
4313
|
+
const blockLoot = import_server10.world.getLootTableManager().generateLootFromBlock(block);
|
|
4275
4314
|
block.setType("minecraft:air");
|
|
4276
4315
|
if (blockLoot) {
|
|
4277
4316
|
for (const itemStack of blockLoot) {
|
|
@@ -4280,11 +4319,11 @@
|
|
|
4280
4319
|
}
|
|
4281
4320
|
return;
|
|
4282
4321
|
}
|
|
4283
|
-
if (Math.random() *
|
|
4322
|
+
if (Math.random() * import_server10.world.gameRules.randomTickSpeed <= 0.2) {
|
|
4284
4323
|
const blockBelow = block.below();
|
|
4285
4324
|
if (blockBelow.isAir) {
|
|
4286
4325
|
const { color } = params;
|
|
4287
|
-
const molangVariableMap = new
|
|
4326
|
+
const molangVariableMap = new import_server10.MolangVariableMap();
|
|
4288
4327
|
molangVariableMap.setColorRGB("color", {
|
|
4289
4328
|
red: color[0],
|
|
4290
4329
|
green: color[1],
|
|
@@ -4297,14 +4336,14 @@
|
|
|
4297
4336
|
};
|
|
4298
4337
|
|
|
4299
4338
|
// src/block/components/ParticleEmitterBlockComponent.ts
|
|
4300
|
-
var
|
|
4339
|
+
var import_server11 = __require("@minecraft/server");
|
|
4301
4340
|
var ParticleEmitterBlockComponent = class {
|
|
4302
4341
|
constructor() {
|
|
4303
4342
|
this.onRandomTick = this.onRandomTick.bind(this);
|
|
4304
4343
|
}
|
|
4305
4344
|
onRandomTick({ block, dimension }, { params }) {
|
|
4306
4345
|
const { particle, spawn_rate } = params;
|
|
4307
|
-
if (Math.random() *
|
|
4346
|
+
if (Math.random() * import_server11.world.gameRules.randomTickSpeed <= spawn_rate) {
|
|
4308
4347
|
try {
|
|
4309
4348
|
const aboveBlock = block.above();
|
|
4310
4349
|
if (aboveBlock.isAir) {
|
|
@@ -4317,7 +4356,7 @@
|
|
|
4317
4356
|
};
|
|
4318
4357
|
|
|
4319
4358
|
// src/block/components/SaplingBlockComponent.ts
|
|
4320
|
-
var
|
|
4359
|
+
var import_server12 = __require("@minecraft/server");
|
|
4321
4360
|
function tryPlaceFeature(blockSapling, params) {
|
|
4322
4361
|
const { feature } = params;
|
|
4323
4362
|
const featurePlaced = blockSapling.dimension.placeFeature(feature, blockSapling.location);
|
|
@@ -4332,13 +4371,13 @@
|
|
|
4332
4371
|
}
|
|
4333
4372
|
onPlayerInteract({ block, player }, { params }) {
|
|
4334
4373
|
if (player) {
|
|
4335
|
-
const mainhand = EntityUtil.getEquippedItem(player,
|
|
4374
|
+
const mainhand = EntityUtil.getEquippedItem(player, import_server12.EquipmentSlot.Mainhand);
|
|
4336
4375
|
if (!mainhand || mainhand.typeId !== "minecraft:bone_meal") return;
|
|
4337
4376
|
const { permutation } = block;
|
|
4338
4377
|
const ageBit = Number(permutation.getState("dbe:age_bit"));
|
|
4339
4378
|
applyGrowthEffects(block);
|
|
4340
4379
|
ItemUtil.decrementStack(player);
|
|
4341
|
-
if (player.getGameMode() ===
|
|
4380
|
+
if (player.getGameMode() === import_server12.GameMode.Creative) {
|
|
4342
4381
|
tryPlaceFeature(block, params);
|
|
4343
4382
|
return;
|
|
4344
4383
|
}
|
|
@@ -4364,8 +4403,22 @@
|
|
|
4364
4403
|
}
|
|
4365
4404
|
};
|
|
4366
4405
|
|
|
4406
|
+
// src/item/components/DurabilitySensorItemComponent.ts
|
|
4407
|
+
var DurabilitySensorItemComponent = class {
|
|
4408
|
+
constructor() {
|
|
4409
|
+
this.onHitEntity = this.onHitEntity.bind(this);
|
|
4410
|
+
this.onMineBlock = this.onMineBlock.bind(this);
|
|
4411
|
+
}
|
|
4412
|
+
onHitEntity({ hitEntity }) {
|
|
4413
|
+
ItemUtil.tryDamageHeldItem(hitEntity, 1);
|
|
4414
|
+
}
|
|
4415
|
+
onMineBlock({ source }) {
|
|
4416
|
+
ItemUtil.tryDamageHeldItem(source, 1);
|
|
4417
|
+
}
|
|
4418
|
+
};
|
|
4419
|
+
|
|
4367
4420
|
// src/misc/DynamicDatabase.ts
|
|
4368
|
-
var
|
|
4421
|
+
var import_server13 = __require("@minecraft/server");
|
|
4369
4422
|
var DynamicDatabase = class _DynamicDatabase {
|
|
4370
4423
|
constructor(provider, dataId) {
|
|
4371
4424
|
this.provider = provider;
|
|
@@ -4378,7 +4431,7 @@
|
|
|
4378
4431
|
isSaving = false;
|
|
4379
4432
|
lastSerializedData;
|
|
4380
4433
|
static getInstance(provider, dataId) {
|
|
4381
|
-
if (provider instanceof
|
|
4434
|
+
if (provider instanceof import_server13.Entity && !provider.isValid) {
|
|
4382
4435
|
return void 0;
|
|
4383
4436
|
}
|
|
4384
4437
|
if (!this.instances.has(provider)) {
|
|
@@ -4425,7 +4478,7 @@
|
|
|
4425
4478
|
this.saveOnNextTick();
|
|
4426
4479
|
}
|
|
4427
4480
|
save() {
|
|
4428
|
-
if (this.provider instanceof
|
|
4481
|
+
if (this.provider instanceof import_server13.World || this.provider.isValid) {
|
|
4429
4482
|
const serialized = this.toString();
|
|
4430
4483
|
if (serialized === this.lastSerializedData) return;
|
|
4431
4484
|
this.lastSerializedData = serialized;
|
|
@@ -4445,7 +4498,7 @@
|
|
|
4445
4498
|
saveOnNextTick() {
|
|
4446
4499
|
if (!this.isSaving) {
|
|
4447
4500
|
this.isSaving = true;
|
|
4448
|
-
|
|
4501
|
+
import_server13.system.runTimeout(() => {
|
|
4449
4502
|
this.save();
|
|
4450
4503
|
this.isSaving = false;
|
|
4451
4504
|
}, 2);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/item/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=PlayerGroup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PlayerGroup.d.ts","sourceRoot":"","sources":["../../../src/tests/playerGroup/PlayerGroup.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=groupCommands.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"groupCommands.d.ts","sourceRoot":"","sources":["../../../src/tests/playerGroup/groupCommands.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Dimension, Vector3, VectorXZ } from "@minecraft/server";
|
|
2
|
+
declare class ChunkManager {
|
|
3
|
+
readonly dimension: Dimension;
|
|
4
|
+
readonly chunkOrigin: VectorXZ;
|
|
5
|
+
readonly chunkXZ: VectorXZ;
|
|
6
|
+
readonly id: string;
|
|
7
|
+
isGenerated: boolean;
|
|
8
|
+
constructor(dimension: Dimension, location: VectorXZ);
|
|
9
|
+
get isLoaded(): boolean;
|
|
10
|
+
}
|
|
11
|
+
declare class ChunkUtil {
|
|
12
|
+
private static chunksCache;
|
|
13
|
+
static getChunk(dimension: Dimension, location: Vector3): ChunkManager | undefined;
|
|
14
|
+
static getChunkId(location: VectorXZ): string;
|
|
15
|
+
static getChunkXZ(location: VectorXZ): VectorXZ;
|
|
16
|
+
static waitForChunkLoad(dimension: Dimension, location: Vector3): Promise<void>;
|
|
17
|
+
}
|
|
18
|
+
export { ChunkManager, ChunkUtil };
|
|
19
|
+
//# sourceMappingURL=ChunkUtil.d.ts.map
|
|
@@ -0,0 +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,OAAO,GAAG,YAAY,GAAG,SAAS;IAalF,MAAM,CAAC,UAAU,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM;IAK7C,MAAM,CAAC,UAAU,CAAC,QAAQ,EAAE,QAAQ,GAAG,QAAQ;WAOlC,gBAAgB,CAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;CAWxF;AAID,OAAO,EACH,YAAY,EACZ,SAAS,EACZ,CAAC"}
|
|
@@ -8,7 +8,5 @@ export declare class WorldUtil {
|
|
|
8
8
|
static applyAreaDamage(dimension: Dimension, location: Vector3, radius: number, amount: number, options?: EntityApplyDamageByProjectileOptions | EntityApplyDamageOptions): Entity[];
|
|
9
9
|
static getTimeOfDay(): string | undefined;
|
|
10
10
|
static isValidSpawnLocation(dimension: Dimension, location: Vector3): boolean;
|
|
11
|
-
static spawnIndicator(dimension: Dimension, location: Vector3, text: string): void;
|
|
12
|
-
static waitForChunkLoad(dimension: Dimension, location: Vector3): Promise<void>;
|
|
13
11
|
}
|
|
14
12
|
//# sourceMappingURL=WorldUtil.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorldUtil.d.ts","sourceRoot":"","sources":["../../src/utils/WorldUtil.ts"],"names":[],"mappings":"AACA,OAAO,EAAS,SAAS,EAAE,MAAM,EAAE,oCAAoC,EAAE,wBAAwB,
|
|
1
|
+
{"version":3,"file":"WorldUtil.d.ts","sourceRoot":"","sources":["../../src/utils/WorldUtil.ts"],"names":[],"mappings":"AACA,OAAO,EAAS,SAAS,EAAE,MAAM,EAAE,oCAAoC,EAAE,wBAAwB,EAAa,OAAO,EAAS,MAAM,mBAAmB,CAAC;AAKxJ,qBAAa,SAAS;IAClB,MAAM,KAAK,UAAU;;;;MAMpB;IAED,MAAM,CAAC,eAAe,CAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,oCAAoC,GAAG,wBAAwB,GAAG,MAAM,EAAE;IAoBpL,MAAM,CAAC,YAAY,IAAI,MAAM,GAAG,SAAS;IAUzC,MAAM,CAAC,oBAAoB,CAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,GAAG,OAAO;CAuBhF"}
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC"}
|