| 1 | import test from "node:test"; |
| 2 | import assert from "node:assert/strict"; |
| 3 | import { createEmptyChunkData, encodeChunkBlob } from "../src/world/chunkData.js"; |
| 4 | import { makeCharacter, ensureDimension, makeDimensionSimulation } from "./helpers/simulationHarness.js"; |
| 5 | import { ItemId } from "../../shared/definitions/items.js"; |
| 6 | import { Component } from "../src/ecs/components.js"; |
| 7 | import |
| 8 | { |
| 9 | normalizeItemSpawnerConfig, |
| 10 | ItemSpawnerAppearance, |
| 11 | ITEM_SPAWNER_OPEN_DURATION_MS |
| 12 | } from "../../shared/definitions/itemSpawners.js"; |
| 13 | import { emptySlots, emptyEquipment } from "../../shared/items/inventory.js"; |
| 14 | import { OVERWORLD_ID } from "../../shared/world/dimensions.js"; |
| 15 | import |
| 16 | { |
| 17 | itemContainerAtTile, |
| 18 | itemContainersInChunk, |
| 19 | ensureItemSpawnerState |
| 20 | } from "../src/itemSpawners/service.js"; |
| 21 | |
| 22 | const CAVE_ID = "item-spawner-cave"; |
| 23 | |
| 24 | function workerOf (simulation, playerId) |
| 25 | { |
| 26 | const record = simulation.entityRecord(playerId); |
| 27 | return simulation.workers[record.workerId]; |
| 28 | } |
| 29 | |
| 30 | function advanceMs (harness, ms) |
| 31 | { |
| 32 | const ticks = Math.ceil(ms / 50) + 3; |
| 33 | for (let i = 0; i < ticks; i++) |
| 34 | { |
| 35 | harness.advance(50); |
| 36 | harness.simulation.step(); |
| 37 | } |
| 38 | } |
| 39 | |
| 40 | function placeItemSpawner (harness, localX, localY, config, dimensionId) |
| 41 | { |
| 42 | ensureDimension(harness.worldDb, dimensionId); |
| 43 | const data = createEmptyChunkData(); |
| 44 | data.open = true; |
| 45 | data.spawners = [{ |
| 46 | localX, |
| 47 | localY, |
| 48 | config: normalizeItemSpawnerConfig({ |
| 49 | spawnerId: `item-${localX}-${localY}`, |
| 50 | ...config |
| 51 | }) |
| 52 | }]; |
| 53 | harness.worldDb.saveChunkVersion( |
| 54 | 0, |
| 55 | 0, |
| 56 | harness.worldDb.getActiveRevisionId(), |
| 57 | true, |
| 58 | encodeChunkBlob(data), |
| 59 | dimensionId |
| 60 | ); |
| 61 | harness.simulation.reloadWorld(); |
| 62 | } |
| 63 | |
| 64 | function spawnInCave (harness, tileX, tileY) |
| 65 | { |
| 66 | const character = makeCharacter(harness.stateDb, { tileX, tileY }); |
| 67 | harness.stateDb.saveCharacterPosition(character.character_id, tileX, tileY, "walk", CAVE_ID); |
| 68 | harness.stateDb.saveBag(character.character_id, { |
| 69 | inventory: emptySlots(), |
| 70 | equipment: emptyEquipment(), |
| 71 | vault: [], |
| 72 | vaultReserved: [] |
| 73 | }); |
| 74 | const playerId = harness.simulation.spawnCharacter(1, character); |
| 75 | assert.equal(harness.simulation.positionOf(playerId).dimensionId, CAVE_ID); |
| 76 | return { character, playerId }; |
| 77 | } |
| 78 | |
| 79 | test("chest container spawns in custom dimension (not overworld)", () => |
| 80 | { |
| 81 | const harness = makeDimensionSimulation(CAVE_ID, { workerCount: 1 }); |
| 82 | try |
| 83 | { |
| 84 | placeItemSpawner(harness, 9, 8, { |
| 85 | appearance: ItemSpawnerAppearance.chest, |
| 86 | material: "oak", |
| 87 | items: [{ itemId: ItemId.apple, quantity: 2 }], |
| 88 | respawnDelaySeconds: 60, |
| 89 | spawnRangeTiles: 0 |
| 90 | }, CAVE_ID); |
| 91 | const { playerId } = spawnInCave(harness, 8, 8); |
| 92 | advanceMs(harness, 200); |
| 93 | |
| 94 | const worker = workerOf(harness.simulation, playerId); |
| 95 | const caveContainer = itemContainerAtTile(worker.world, 9, 8, CAVE_ID); |
| 96 | assert.ok(caveContainer, "expected chest in cave"); |
| 97 | assert.equal(caveContainer.dimensionId, CAVE_ID); |
| 98 | assert.equal(itemContainerAtTile(worker.world, 9, 8, OVERWORLD_ID), null); |
| 99 | |
| 100 | const appear = [...ensureItemSpawnerState(worker.world).active.values()] |
| 101 | .find((e) => e.mode === "container" && e.dimensionId === CAVE_ID); |
| 102 | assert.ok(appear); |
| 103 | assert.match(appear.spawnerId, new RegExp(`^${CAVE_ID}:`)); |
| 104 | } |
| 105 | finally |
| 106 | { harness.close(); } |
| 107 | }); |
| 108 | |
| 109 | test("open container from adjacent tile in same dimension grants loot", () => |
| 110 | { |
| 111 | const harness = makeDimensionSimulation(CAVE_ID, { workerCount: 1 }); |
| 112 | try |
| 113 | { |
| 114 | placeItemSpawner(harness, 9, 8, { |
| 115 | appearance: ItemSpawnerAppearance.barrel, |
| 116 | items: [{ itemId: ItemId.apple, quantity: 2 }], |
| 117 | respawnDelaySeconds: 60, |
| 118 | spawnRangeTiles: 0 |
| 119 | }, CAVE_ID); |
| 120 | const { character, playerId } = spawnInCave(harness, 8, 8); |
| 121 | advanceMs(harness, 200); |
| 122 | |
| 123 | const worker = workerOf(harness.simulation, playerId); |
| 124 | const container = itemContainerAtTile(worker.world, 9, 8, CAVE_ID); |
| 125 | assert.ok(container); |
| 126 | |
| 127 | harness.simulation.enqueue(1, { |
| 128 | type: "open-item-container", |
| 129 | characterId: character.character_id, |
| 130 | containerId: container.containerId |
| 131 | }); |
| 132 | harness.simulation.step(); |
| 133 | advanceMs(harness, ITEM_SPAWNER_OPEN_DURATION_MS + 200); |
| 134 | |
| 135 | assert.equal(itemContainerAtTile(worker.world, 9, 8, CAVE_ID), null); |
| 136 | const inventory = worker.world.ecs.get( |
| 137 | worker.world.ecs.handleOf(playerId), |
| 138 | Component.inventory |
| 139 | ); |
| 140 | const qty = (inventory?.slots ?? []) |
| 141 | .filter((s) => s?.itemId === ItemId.apple) |
| 142 | .reduce((n, s) => n + (s.quantity | 0), 0); |
| 143 | assert.equal(qty, 2); |
| 144 | } |
| 145 | finally |
| 146 | { harness.close(); } |
| 147 | }); |
| 148 | |
| 149 | test("open container rejects player in wrong dimension", () => |
| 150 | { |
| 151 | const harness = makeDimensionSimulation(CAVE_ID, { workerCount: 1 }); |
| 152 | try |
| 153 | { |
| 154 | placeItemSpawner(harness, 9, 8, { |
| 155 | appearance: ItemSpawnerAppearance.crate, |
| 156 | items: [{ itemId: ItemId.stick, quantity: 1 }], |
| 157 | spawnRangeTiles: 0 |
| 158 | }, CAVE_ID); |
| 159 | |
| 160 | // Seed cave sim so the container actually spawns, then leave a player in overworld. |
| 161 | const seeder = makeCharacter(harness.stateDb, { tileX: 8, tileY: 8, lastName: "Seeder" }); |
| 162 | harness.stateDb.saveCharacterPosition(seeder.character_id, 8, 8, "walk", CAVE_ID); |
| 163 | const seederId = harness.simulation.spawnCharacter(2, seeder); |
| 164 | advanceMs(harness, 200); |
| 165 | const caveWorker = workerOf(harness.simulation, seederId); |
| 166 | const container = itemContainerAtTile(caveWorker.world, 9, 8, CAVE_ID); |
| 167 | assert.ok(container, "cave container must exist"); |
| 168 | const containerId = container.containerId; |
| 169 | |
| 170 | const overworld = makeCharacter(harness.stateDb, { tileX: 8, tileY: 8, lastName: "Overworld" }); |
| 171 | harness.stateDb.saveBag(overworld.character_id, { |
| 172 | inventory: emptySlots(), |
| 173 | equipment: emptyEquipment(), |
| 174 | vault: [], |
| 175 | vaultReserved: [] |
| 176 | }); |
| 177 | const overworldId = harness.simulation.spawnCharacter(1, overworld); |
| 178 | assert.equal(harness.simulation.positionOf(overworldId).dimensionId, OVERWORLD_ID); |
| 179 | |
| 180 | harness.simulation.enqueue(1, { |
| 181 | type: "open-item-container", |
| 182 | characterId: overworld.character_id, |
| 183 | containerId |
| 184 | }); |
| 185 | const step = harness.simulation.step(); |
| 186 | const err = step.events.find((e) => e.type === "command-error"); |
| 187 | assert.ok(err, JSON.stringify(step.events)); |
| 188 | assert.match(err.message, /gone|container/i); |
| 189 | assert.ok( |
| 190 | itemContainerAtTile(caveWorker.world, 9, 8, CAVE_ID), |
| 191 | "wrong-dim open must not consume cave container" |
| 192 | ); |
| 193 | } |
| 194 | finally |
| 195 | { harness.close(); } |
| 196 | }); |
| 197 | |
| 198 | test("chunk snapshot itemContainers are filtered by dimension", () => |
| 199 | { |
| 200 | const harness = makeDimensionSimulation(CAVE_ID, { workerCount: 1 }); |
| 201 | try |
| 202 | { |
| 203 | placeItemSpawner(harness, 9, 8, { |
| 204 | appearance: ItemSpawnerAppearance.chest, |
| 205 | items: [{ itemId: ItemId.stick, quantity: 1 }], |
| 206 | spawnRangeTiles: 0 |
| 207 | }, CAVE_ID); |
| 208 | const { playerId } = spawnInCave(harness, 8, 8); |
| 209 | advanceMs(harness, 200); |
| 210 | |
| 211 | const worker = workerOf(harness.simulation, playerId); |
| 212 | const caveOnly = itemContainersInChunk(worker.world, 0, 0, CAVE_ID); |
| 213 | const overworldOnly = itemContainersInChunk(worker.world, 0, 0, OVERWORLD_ID); |
| 214 | assert.equal(caveOnly.length, 1); |
| 215 | assert.equal(caveOnly[0].dimensionId, CAVE_ID); |
| 216 | assert.equal(overworldOnly.length, 0); |
| 217 | |
| 218 | const caveSnap = harness.simulation.snapshotChunk(0, 0, false, CAVE_ID); |
| 219 | const overSnap = harness.simulation.snapshotChunk(0, 0, false, OVERWORLD_ID); |
| 220 | assert.equal(caveSnap.dimensionId, CAVE_ID); |
| 221 | assert.equal(caveSnap.itemContainers?.length, 1); |
| 222 | assert.equal(caveSnap.itemContainers[0].dimensionId, CAVE_ID); |
| 223 | assert.equal(overSnap.dimensionId, OVERWORLD_ID); |
| 224 | assert.equal(overSnap.itemContainers?.length ?? 0, 0); |
| 225 | } |
| 226 | finally |
| 227 | { harness.close(); } |
| 228 | }); |
| 229 | |
| 230 | test("item appearance ground pile spawns and respawns in custom dimension", () => |
| 231 | { |
| 232 | const harness = makeDimensionSimulation(CAVE_ID, { workerCount: 1 }); |
| 233 | try |
| 234 | { |
| 235 | placeItemSpawner(harness, 9, 8, { |
| 236 | appearance: ItemSpawnerAppearance.item, |
| 237 | items: [{ itemId: ItemId.stick, quantity: 3 }], |
| 238 | respawnDelaySeconds: 1, |
| 239 | spawnRangeTiles: 0 |
| 240 | }, CAVE_ID); |
| 241 | const { character, playerId } = spawnInCave(harness, 9, 8); |
| 242 | advanceMs(harness, 200); |
| 243 | |
| 244 | const worker = workerOf(harness.simulation, playerId); |
| 245 | const ground = [...worker.world.groundItems.values()].filter( |
| 246 | (item) => (item.source === "item-spawner" || item.itemSpawnerId) |
| 247 | && item.dimensionId === CAVE_ID |
| 248 | ); |
| 249 | assert.ok(ground.length >= 1, "expected cave spawner ground item"); |
| 250 | assert.equal(ground[0].stack.itemId, ItemId.stick); |
| 251 | assert.equal( |
| 252 | [...worker.world.groundItems.values()].filter( |
| 253 | (item) => (item.source === "item-spawner" || item.itemSpawnerId) |
| 254 | && item.dimensionId === OVERWORLD_ID |
| 255 | ).length, |
| 256 | 0 |
| 257 | ); |
| 258 | |
| 259 | const groundItemId = ground[0].groundItemId; |
| 260 | harness.simulation.enqueue(1, { |
| 261 | type: "pickup-item", |
| 262 | characterId: character.character_id, |
| 263 | groundItemId |
| 264 | }); |
| 265 | harness.simulation.step(); |
| 266 | assert.equal( |
| 267 | [...worker.world.groundItems.values()].filter((i) => i.itemSpawnerId).length, |
| 268 | 0 |
| 269 | ); |
| 270 | |
| 271 | advanceMs(harness, 1500); |
| 272 | const again = [...worker.world.groundItems.values()].filter( |
| 273 | (item) => (item.source === "item-spawner" || item.itemSpawnerId) |
| 274 | && item.dimensionId === CAVE_ID |
| 275 | ); |
| 276 | assert.ok(again.length >= 1, "expected respawned ground item still in cave"); |
| 277 | assert.equal(again[0].dimensionId, CAVE_ID); |
| 278 | } |
| 279 | finally |
| 280 | { harness.close(); } |
| 281 | }); |
| 282 | |
| 283 | test("container respawn stays in custom dimension after open", () => |
| 284 | { |
| 285 | const harness = makeDimensionSimulation(CAVE_ID, { workerCount: 1 }); |
| 286 | try |
| 287 | { |
| 288 | placeItemSpawner(harness, 9, 8, { |
| 289 | appearance: ItemSpawnerAppearance.chest, |
| 290 | items: [{ itemId: ItemId.apple, quantity: 1 }], |
| 291 | respawnDelaySeconds: 1, |
| 292 | spawnRangeTiles: 0 |
| 293 | }, CAVE_ID); |
| 294 | const { character, playerId } = spawnInCave(harness, 8, 8); |
| 295 | advanceMs(harness, 200); |
| 296 | |
| 297 | const worker = workerOf(harness.simulation, playerId); |
| 298 | const container = itemContainerAtTile(worker.world, 9, 8, CAVE_ID); |
| 299 | assert.ok(container); |
| 300 | |
| 301 | harness.simulation.enqueue(1, { |
| 302 | type: "open-item-container", |
| 303 | characterId: character.character_id, |
| 304 | containerId: container.containerId |
| 305 | }); |
| 306 | harness.simulation.step(); |
| 307 | advanceMs(harness, ITEM_SPAWNER_OPEN_DURATION_MS + 200); |
| 308 | assert.equal(itemContainerAtTile(worker.world, 9, 8, CAVE_ID), null); |
| 309 | |
| 310 | advanceMs(harness, 1500); |
| 311 | const again = itemContainerAtTile(worker.world, 9, 8, CAVE_ID); |
| 312 | assert.ok(again, "expected chest respawn in cave"); |
| 313 | assert.equal(again.dimensionId, CAVE_ID); |
| 314 | assert.equal(itemContainerAtTile(worker.world, 9, 8, OVERWORLD_ID), null); |
| 315 | } |
| 316 | finally |
| 317 | { harness.close(); } |
| 318 | }); |
| 319 | |
| 320 | const SHARED_LOCAL_ID = "shared-local-spawner"; |
| 321 | |
| 322 | function placeItemSpawnerWithId (harness, localX, localY, config, dimensionId, spawnerId) |
| 323 | { |
| 324 | ensureDimension(harness.worldDb, dimensionId); |
| 325 | const data = createEmptyChunkData(); |
| 326 | data.open = true; |
| 327 | data.spawners = [{ |
| 328 | localX, |
| 329 | localY, |
| 330 | config: normalizeItemSpawnerConfig({ |
| 331 | spawnerId, |
| 332 | ...config |
| 333 | }) |
| 334 | }]; |
| 335 | harness.worldDb.saveChunkVersion( |
| 336 | 0, |
| 337 | 0, |
| 338 | harness.worldDb.getActiveRevisionId(), |
| 339 | true, |
| 340 | encodeChunkBlob(data), |
| 341 | dimensionId |
| 342 | ); |
| 343 | harness.simulation.reloadWorld(); |
| 344 | } |
| 345 | |
| 346 | test("authored overworld + cave item spawners with same local spawnerId stay independent", () => |
| 347 | { |
| 348 | const harness = makeDimensionSimulation(CAVE_ID, { workerCount: 1 }); |
| 349 | try |
| 350 | { |
| 351 | placeItemSpawnerWithId(harness, 9, 8, { |
| 352 | appearance: ItemSpawnerAppearance.chest, |
| 353 | material: "oak", |
| 354 | items: [{ itemId: ItemId.apple, quantity: 1 }], |
| 355 | respawnDelaySeconds: 60, |
| 356 | spawnRangeTiles: 0 |
| 357 | }, OVERWORLD_ID, SHARED_LOCAL_ID); |
| 358 | placeItemSpawnerWithId(harness, 9, 8, { |
| 359 | appearance: ItemSpawnerAppearance.chest, |
| 360 | material: "oak", |
| 361 | items: [{ itemId: ItemId.stick, quantity: 1 }], |
| 362 | respawnDelaySeconds: 60, |
| 363 | spawnRangeTiles: 0 |
| 364 | }, CAVE_ID, SHARED_LOCAL_ID); |
| 365 | |
| 366 | const overworld = makeCharacter(harness.stateDb, { tileX: 8, tileY: 8, lastName: "Over" }); |
| 367 | harness.stateDb.saveBag(overworld.character_id, { |
| 368 | inventory: emptySlots(), |
| 369 | equipment: emptyEquipment(), |
| 370 | vault: [], |
| 371 | vaultReserved: [] |
| 372 | }); |
| 373 | const overworldId = harness.simulation.spawnCharacter(1, overworld); |
| 374 | assert.equal(harness.simulation.positionOf(overworldId).dimensionId, OVERWORLD_ID); |
| 375 | |
| 376 | const caveChar = makeCharacter(harness.stateDb, { tileX: 8, tileY: 8, lastName: "CaveLoot" }); |
| 377 | harness.stateDb.saveCharacterPosition(caveChar.character_id, 8, 8, "walk", CAVE_ID); |
| 378 | harness.stateDb.saveBag(caveChar.character_id, { |
| 379 | inventory: emptySlots(), |
| 380 | equipment: emptyEquipment(), |
| 381 | vault: [], |
| 382 | vaultReserved: [] |
| 383 | }); |
| 384 | const playerId = harness.simulation.spawnCharacter(2, caveChar); |
| 385 | assert.equal(harness.simulation.positionOf(playerId).dimensionId, CAVE_ID); |
| 386 | advanceMs(harness, 200); |
| 387 | |
| 388 | const caveWorker = workerOf(harness.simulation, playerId); |
| 389 | const overWorker = workerOf(harness.simulation, overworldId); |
| 390 | const caveContainer = itemContainerAtTile(caveWorker.world, 9, 8, CAVE_ID); |
| 391 | const overContainer = itemContainerAtTile(overWorker.world, 9, 8, OVERWORLD_ID); |
| 392 | assert.ok(caveContainer, "expected cave chest"); |
| 393 | assert.ok(overContainer, "expected overworld chest"); |
| 394 | assert.equal(caveContainer.dimensionId, CAVE_ID); |
| 395 | assert.equal(overContainer.dimensionId, OVERWORLD_ID); |
| 396 | assert.notEqual(caveContainer.containerId, overContainer.containerId); |
| 397 | assert.equal(caveContainer.spawnerId, `${CAVE_ID}:${SHARED_LOCAL_ID}`); |
| 398 | assert.equal(overContainer.spawnerId, `${OVERWORLD_ID}:${SHARED_LOCAL_ID}`); |
| 399 | |
| 400 | const active = [...ensureItemSpawnerState(caveWorker.world).active.values()]; |
| 401 | const caveActive = active.filter((e) => e.dimensionId === CAVE_ID && e.spawnerId.endsWith(`:${SHARED_LOCAL_ID}`)); |
| 402 | const overActive = active.filter((e) => e.dimensionId === OVERWORLD_ID && e.spawnerId.endsWith(`:${SHARED_LOCAL_ID}`)); |
| 403 | assert.equal(caveActive.length, 1); |
| 404 | assert.equal(overActive.length, 1); |
| 405 | |
| 406 | harness.simulation.enqueue(2, { |
| 407 | type: "open-item-container", |
| 408 | characterId: caveChar.character_id, |
| 409 | containerId: caveContainer.containerId |
| 410 | }); |
| 411 | harness.simulation.step(); |
| 412 | advanceMs(harness, ITEM_SPAWNER_OPEN_DURATION_MS + 200); |
| 413 | |
| 414 | assert.equal(itemContainerAtTile(caveWorker.world, 9, 8, CAVE_ID), null, "cave chest consumed"); |
| 415 | assert.ok( |
| 416 | itemContainerAtTile(overWorker.world, 9, 8, OVERWORLD_ID), |
| 417 | "overworld chest must remain after cave open" |
| 418 | ); |
| 419 | const inventory = caveWorker.world.ecs.get( |
| 420 | caveWorker.world.ecs.handleOf(playerId), |
| 421 | Component.inventory |
| 422 | ); |
| 423 | const sticks = (inventory?.slots ?? []) |
| 424 | .filter((s) => s?.itemId === ItemId.stick) |
| 425 | .reduce((n, s) => n + (s.quantity | 0), 0); |
| 426 | assert.equal(sticks, 1, "cave chest grants cave loot only"); |
| 427 | } |
| 428 | finally |
| 429 | { harness.close(); } |
| 430 | }); |
| 431 | |
| 432 | test("authored overworld + cave ground item spawners with same local spawnerId stay independent", () => |
| 433 | { |
| 434 | const harness = makeDimensionSimulation(CAVE_ID, { workerCount: 1 }); |
| 435 | try |
| 436 | { |
| 437 | placeItemSpawnerWithId(harness, 9, 8, { |
| 438 | appearance: ItemSpawnerAppearance.item, |
| 439 | items: [{ itemId: ItemId.apple, quantity: 1 }], |
| 440 | respawnDelaySeconds: 60, |
| 441 | spawnRangeTiles: 0 |
| 442 | }, OVERWORLD_ID, SHARED_LOCAL_ID); |
| 443 | placeItemSpawnerWithId(harness, 9, 8, { |
| 444 | appearance: ItemSpawnerAppearance.item, |
| 445 | items: [{ itemId: ItemId.stick, quantity: 1 }], |
| 446 | respawnDelaySeconds: 60, |
| 447 | spawnRangeTiles: 0 |
| 448 | }, CAVE_ID, SHARED_LOCAL_ID); |
| 449 | |
| 450 | const overworld = makeCharacter(harness.stateDb, { tileX: 8, tileY: 8, lastName: "PileOver" }); |
| 451 | const overworldId = harness.simulation.spawnCharacter(1, overworld); |
| 452 | const caveChar = makeCharacter(harness.stateDb, { tileX: 8, tileY: 8, lastName: "PileCave" }); |
| 453 | harness.stateDb.saveCharacterPosition(caveChar.character_id, 8, 8, "walk", CAVE_ID); |
| 454 | const playerId = harness.simulation.spawnCharacter(2, caveChar); |
| 455 | assert.equal(harness.simulation.positionOf(playerId).dimensionId, CAVE_ID); |
| 456 | advanceMs(harness, 200); |
| 457 | |
| 458 | const worker = workerOf(harness.simulation, playerId); |
| 459 | const caveGround = [...worker.world.groundItems.values()].filter( |
| 460 | (item) => item.itemSpawnerId === `${CAVE_ID}:${SHARED_LOCAL_ID}` |
| 461 | ); |
| 462 | const overGround = [...worker.world.groundItems.values()].filter( |
| 463 | (item) => item.itemSpawnerId === `${OVERWORLD_ID}:${SHARED_LOCAL_ID}` |
| 464 | ); |
| 465 | assert.equal(caveGround.length, 1); |
| 466 | assert.equal(overGround.length, 1); |
| 467 | assert.equal(caveGround[0].dimensionId, CAVE_ID); |
| 468 | assert.equal(overGround[0].dimensionId, OVERWORLD_ID); |
| 469 | assert.equal(caveGround[0].stack.itemId, ItemId.stick); |
| 470 | assert.equal(overGround[0].stack.itemId, ItemId.apple); |
| 471 | void overworldId; |
| 472 | } |
| 473 | finally |
| 474 | { harness.close(); } |
| 475 | }); |