diff --git a/.eslintrc.json b/.eslintrc.json index a91015d2..c9fa60e2 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -7,6 +7,7 @@ "rules": { "space-infix-ops": "error", "no-multi-spaces": "error", + "no-trailing-spaces": "error", "space-before-function-paren": "error", "space-in-parens": [ "error", diff --git a/esbuild.mjs b/esbuild.mjs index 1f075a62..3dfe9939 100644 --- a/esbuild.mjs +++ b/esbuild.mjs @@ -88,6 +88,7 @@ const buildOptions = { '.woff': 'dataurl', '.woff2': 'dataurl', '.ttf': 'dataurl', + '.webp': 'dataurl', }, write: false, // todo would be better to enable? diff --git a/scripts/buildNpmReact.ts b/scripts/buildNpmReact.ts index 4516f1b7..bc0fc192 100644 --- a/scripts/buildNpmReact.ts +++ b/scripts/buildNpmReact.ts @@ -53,6 +53,10 @@ fs.promises.readdir(path.resolve(__dirname, '../src/react')).then(async (files) write: false, // todo loader: { '.png': 'dataurl', + '.jpg': 'dataurl', + '.jpeg': 'dataurl', + '.webp': 'dataurl', + '.css': 'text', }, plugins: [ // on external module resolve diff --git a/src/globals.d.ts b/src/globals.d.ts index f8699f21..4abc0822 100644 --- a/src/globals.d.ts +++ b/src/globals.d.ts @@ -25,6 +25,7 @@ declare const customEvents: import('typed-emitter').default<{ gameLoaded (): void mineflayerBotCreated (): void search (q: string): void + activateItem (item: Item, slot: number, offhand: boolean): void }> declare const beforeRenderFrame: Array<() => void> diff --git a/src/localServerMultiplayer.ts b/src/localServerMultiplayer.ts index ca85c126..c8e4bc5e 100644 --- a/src/localServerMultiplayer.ts +++ b/src/localServerMultiplayer.ts @@ -52,7 +52,7 @@ export const openToWanAndCopyJoinLink = async (writeText: (text) => void, doCopy peerInstance = peer peer.on('connection', (connection) => { console.log('connection') - const serverDuplex = new CustomDuplex({}, (data) => connection.send(data)) + const serverDuplex = new CustomDuplex({}, async (data) => connection.send(data)) const client = new Client(true, localServer.options.version, undefined) client.setSocket(serverDuplex) localServer._server.emit('connection', client) diff --git a/src/react/AddServerOrConnect.tsx b/src/react/AddServerOrConnect.tsx index 535e3ee9..2c38a894 100644 --- a/src/react/AddServerOrConnect.tsx +++ b/src/react/AddServerOrConnect.tsx @@ -101,7 +101,6 @@ export default ({ onBack, onConfirm, title = 'Add a Server', initialData, parseQ }}> Account Override