diff --git a/lib/features.json b/lib/features.json index b7c2655f1a..75fab0a24a 100644 --- a/lib/features.json +++ b/lib/features.json @@ -323,5 +323,10 @@ "name": "armAnimationBeforeUse", "description": "arm animation packet sent before use entity packet", "versions": ["1.8", "1.8.9"] + }, + { + "name": "tallWorld", + "description": "world starts at -64 and ends at 384", + "versions": ["1.18", "1.18"] } ] diff --git a/test/externalTests/exampleBlockFinder.js b/test/externalTests/exampleBlockFinder.js index 9eb1f099fe..781b393b91 100644 --- a/test/externalTests/exampleBlockFinder.js +++ b/test/externalTests/exampleBlockFinder.js @@ -3,7 +3,7 @@ const assert = require('assert') module.exports = () => async (bot) => { await bot.test.runExample('examples/blockfinder.js', async (name, cb) => { assert.strictEqual(name, 'finder') - await bot.test.wait(8000) + await bot.test.wait(2000) await bot.test.tellAndListen(name, 'find dirt', (message) => { const matches = message.match(/I found ([0-9]+) (.+?) blocks in (.+?) ms/) if (matches.length !== 4 || matches[1] === '0' || matches[2] !== 'dirt' || parseFloat(matches[3]) > 500) { diff --git a/test/externalTests/exampleInventory.js b/test/externalTests/exampleInventory.js index 511e399529..68e93b55a8 100644 --- a/test/externalTests/exampleInventory.js +++ b/test/externalTests/exampleInventory.js @@ -52,7 +52,7 @@ module.exports = () => async (bot) => { assert.strictEqual(name, 'inventory') bot.chat('/op inventory') // to counteract spawn protection bot.chat('/clear inventory') - bot.chat('/setblock 52 4 0 crafting_table') // to make stone bricks stairs + bot.chat(`/setblock 52 ${bot.test.groundY} 0 crafting_table`) // to make stone bricks stairs bot.chat('/give inventory dirt 64') bot.chat('/give inventory stick 7') bot.chat('/give inventory iron_ore 64') @@ -67,7 +67,7 @@ module.exports = () => async (bot) => { await bot.test.wait(100) } // cleanup - bot.chat('/setblock 52 4 0 air') + bot.chat(`/setblock 52 ${bot.test.groundY} 0 air`) cb() function makeTest (inStr, outStr) { diff --git a/test/externalTests/plugins/testCommon.js b/test/externalTests/plugins/testCommon.js index 91fc5cb55d..52bf67d1bc 100644 --- a/test/externalTests/plugins/testCommon.js +++ b/test/externalTests/plugins/testCommon.js @@ -11,6 +11,7 @@ module.exports = inject function inject (bot) { console.log(bot.version) + bot.test.groundY = bot.supportFeature('tallWorld') ? -60 : 4 const Item = require('prismarine-item')(bot.version) bot.test = {} @@ -66,8 +67,7 @@ function inject (bot) { ] async function resetBlocksToSuperflat () { - const groundY = 4 - for (let y = groundY + 4; y >= groundY - 1; y--) { + for (let y = bot.test.groundY + 4; y >= bot.test.groundY - 1; y--) { bot.chat(`/fill ~-5 ${y} ~-5 ~5 ${y} ~5 ` + layerNames[y]) } await bot.test.wait(100) @@ -85,7 +85,7 @@ function inject (bot) { await becomeCreative() await clearInventory() bot.creative.startFlying() - await teleport(new Vec3(0, 4, 0)) + await teleport(new Vec3(0, bot.test.groundY, 0)) await bot.waitForChunksToLoad() await resetBlocksToSuperflat() await sleep(1000) @@ -197,7 +197,7 @@ function inject (bot) { checkCondition: message => message.json.translate === 'multiplayer.player.joined' }) childBotName = message.json.with[0].insertion - bot.chat(`/tp ${childBotName} 50 4 0`) + bot.chat(`/tp ${childBotName} 50 ${bot.test.groundY} 0`) setTimeout(() => { bot.chat('loaded') }, 5000) diff --git a/test/externalTests/useChests.js b/test/externalTests/useChests.js index faa6910c54..c7bcf9e561 100644 --- a/test/externalTests/useChests.js +++ b/test/externalTests/useChests.js @@ -6,12 +6,14 @@ module.exports = () => async (bot) => { const mcData = require('minecraft-data')(bot.version) const Item = require('prismarine-item')(bot.version) - const smallChestLocation = new Vec3(0, 4, -1) - const largeChestLocations = [new Vec3(0, 4, 1), new Vec3(1, 4, 1)] - const smallTrappedChestLocation = new Vec3(1, 4, 0) + bot.test.groundY = bot.supportFeature('tallWorld') ? -60 : 4 + + const smallChestLocation = new Vec3(0, bot.test.groundY, -1) + const largeChestLocations = [new Vec3(0, bot.test.groundY, 1), new Vec3(1, bot.test.groundY, 1)] + const smallTrappedChestLocation = new Vec3(1, bot.test.groundY, 0) const largeTrappedChestLocations = [ - new Vec3(-1, 4, 1), - new Vec3(-1, 4, 0) + new Vec3(-1, bot.test.groundY, 1), + new Vec3(-1, bot.test.groundY, 0) ] const chestSlot = 36 const trappedChestSlot = 37