{opacity &&
diff --git a/src/react/CreateWorldProvider.tsx b/src/react/CreateWorldProvider.tsx
index 0f99ec42..b01f129c 100644
--- a/src/react/CreateWorldProvider.tsx
+++ b/src/react/CreateWorldProvider.tsx
@@ -1,7 +1,7 @@
-import { supportedVersions } from 'flying-squid/dist/lib/version'
import { hideCurrentModal, showModal } from '../globalState'
import defaultLocalServerOptions from '../defaultLocalServerOptions'
import { mkdirRecursive, uniqueFileNameFromWorldName } from '../browserfs'
+import supportedVersions from '../supportedVersions.mjs'
import CreateWorld, { WorldCustomize, creatingWorldState } from './CreateWorld'
import { getWorldsPath } from './SingleplayerProvider'
import { useIsModalActive } from './utilsApp'
@@ -10,7 +10,8 @@ export default () => {
const activeCreate = useIsModalActive('create-world')
const activeCustomize = useIsModalActive('customize-world')
if (activeCreate) {
- const versions = supportedVersions.map(x => {
+ const versionsPerMinor = Object.fromEntries(supportedVersions.map(x => [x.split('.').slice(0, 2), x]))
+ const versions = Object.values(versionsPerMinor).map(x => {
return {
version: x,
label: x === defaultLocalServerOptions.version ? `${x} (available offline)` : x
diff --git a/src/react/MainMenu.tsx b/src/react/MainMenu.tsx
index 3e3170f4..43908645 100644
--- a/src/react/MainMenu.tsx
+++ b/src/react/MainMenu.tsx
@@ -103,7 +103,7 @@ export default ({ connectToServerAction, mapsProvider, singleplayerAction, optio
icon='pixelarticons:folder'
onClick={openFileAction}
initialTooltip={{
- content: 'Load any 1.8-1.16 Java world' + (haveDirectoryPicker() ? '' : ' (zip)'),
+ content: 'Load any Java world save' + (haveDirectoryPicker() ? '' : ' (zip)!'),
placement: 'bottom-start',
}}
/>
diff --git a/src/soundSystem.ts b/src/soundSystem.ts
index a2cc1f70..e7fdaee7 100644
--- a/src/soundSystem.ts
+++ b/src/soundSystem.ts
@@ -144,10 +144,12 @@ subscribeKey(miscUiState, 'gameLoaded', async () => {
// movement happening
if (Date.now() - lastStepSound > 300) {
const blockUnder = bot.world.getBlock(bot.entity.position.offset(0, -1, 0))
- const stepSound = getStepSound(blockUnder)
- if (stepSound) {
- await playHardcodedSound(stepSound, undefined, 0.6)// todo not sure why 0.6
- lastStepSound = Date.now()
+ if (blockUnder) {
+ const stepSound = getStepSound(blockUnder)
+ if (stepSound) {
+ await playHardcodedSound(stepSound, undefined, 0.6)// todo not sure why 0.6
+ lastStepSound = Date.now()
+ }
}
}
}
diff --git a/src/supportedVersions.mjs b/src/supportedVersions.mjs
index 49d94806..9ff75576 100644
--- a/src/supportedVersions.mjs
+++ b/src/supportedVersions.mjs
@@ -2,4 +2,4 @@ import { supportedVersions } from 'minecraft-data'
const ignoredVersionsRegex = /(^0\.30c$)|w|-pre|-rc/
-export default supportedVersions.pc.filter(v => !ignoredVersionsRegex.test(v))
+export default supportedVersions.pc.filter(x => x !== '1.7').filter(v => !ignoredVersionsRegex.test(v))
diff --git a/src/vr.js b/src/vr.js
index 45c25b3f..92f020f2 100644
--- a/src/vr.js
+++ b/src/vr.js
@@ -4,7 +4,7 @@ const { XRControllerModelFactory } = require('three/examples/jsm/webxr/XRControl
const { buttonMap: standardButtonsMap } = require('contro-max/build/gamepad')
const { activeModalStack, hideModal } = require('./globalState')
-async function initVR () {
+async function initVR() {
const { renderer } = viewer
if (!('xr' in navigator)) return
const isSupported = await navigator.xr.isSessionSupported('immersive-vr') && !!XRSession.prototype.updateRenderState // e.g. android webview doesn't support updateRenderState
diff --git a/src/water.ts b/src/water.ts
index 9f8ec557..d8b4b41c 100644
--- a/src/water.ts
+++ b/src/water.ts
@@ -19,7 +19,7 @@ customEvents.on('gameLoaded', () => {
}
bot.on('physicsTick', () => {
// todo
- const _inWater = bot.world.getBlock(bot.entity.position.offset(0, 1, 0)).name === 'water'
+ const _inWater = bot.world.getBlock(bot.entity.position.offset(0, 1, 0))?.name === 'water'
if (_inWater !== inWater) {
inWater = _inWater
updateInWater()
diff --git a/src/worldInteractions.ts b/src/worldInteractions.ts
index 49c21c2e..777200ca 100644
--- a/src/worldInteractions.ts
+++ b/src/worldInteractions.ts
@@ -18,6 +18,7 @@ import { hideCurrentModal, isGameActive, showModal } from './globalState'
import { assertDefined } from './utils'
import { options } from './optionsStorage'
import { itemBeingUsed } from './react/Crosshair'
+import { isCypress } from './standaloneUtils'
function getViewDirection (pitch, yaw) {
const csPitch = Math.cos(pitch)
@@ -84,16 +85,18 @@ class WorldInteraction {
this.lastBlockPlaced = 4 // ticks since last placed
document.addEventListener('mousedown', (e) => {
- if (e.isTrusted && !document.pointerLockElement) return
+ if (e.isTrusted && !document.pointerLockElement && !isCypress()) return
if (!isGameActive(true)) return
this.buttons[e.button] = true
const entity = getEntityCursor()
- if (entity && e.button === 0) {
- bot.attack(entity)
- } else {
- // bot
+ if (entity) {
+ if (e.button === 0) { // left click
+ bot.attack(entity)
+ } else if (e.button === 2) { // right click
+ void bot.activateEntity(entity)
+ }
}
})
document.addEventListener('blur', (e) => {