Path: blob/master/test/externalTests/dimensionData.js
9427 views
const assert = require('assert')12module.exports = () => {3const tests = []45function addTest (name, f) {6tests[name] = (bot) => f(bot)7}89addTest('overworld properties', async (bot) => {10// After spawn, bot.game.dimension should be set to 'overworld'11assert.ok(bot.game.dimension, 'bot.game.dimension should be set after spawn')12assert.strictEqual(bot.game.dimension, 'overworld', 'Dimension should be overworld on spawn')1314// minY and height should be populated from the dimension codec15assert.strictEqual(typeof bot.game.minY, 'number', 'bot.game.minY should be a number')16assert.strictEqual(typeof bot.game.height, 'number', 'bot.game.height should be a number')17assert.ok(bot.game.height > 0, 'Height should be positive')1819// Overworld in modern versions has minY=-64, height=384; older versions have minY=0, height=25620if (bot.supportFeature('dimensionDataInCodec')) {21assert.strictEqual(bot.game.minY, -64, 'Overworld minY should be -64 for 1.18+')22assert.strictEqual(bot.game.height, 384, 'Overworld height should be 384 for 1.18+')23} else {24assert.ok(bot.game.minY <= 0, 'minY should be <= 0')25assert.ok(bot.game.height >= 256, 'Height should be at least 256')26}27})2829return tests30}313233