Giter VIP home page Giter VIP logo

mineflayer-web-inventory's People

Contributors

airplanegobrr avatar bezouro avatar dependabot[bot] avatar icetank avatar imharvol avatar karang avatar sefirosweb avatar u9g avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

mineflayer-web-inventory's Issues

PartialReadError on 1.18

As can be seen in this CI run https://github.com/imharvol/mineflayer-web-inventory/runs/6212744006?check_suite_focus=true#step:6:91, a PartialReadError: Read error for undefined : undefined is thrown.

PartialReadError: Read error for undefined : undefined
    at new ExtendableError (/home/runner/work/mineflayer-web-inventory/mineflayer-web-inventory/node_modules/protodef/src/utils.js:63:13)
    at new PartialReadError (/home/runner/work/mineflayer-web-inventory/mineflayer-web-inventory/node_modules/protodef/src/utils.js:70:5)
    at Object.readVarInt [as varint] (/home/runner/work/mineflayer-web-inventory/mineflayer-web-inventory/node_modules/protodef/src/datatypes/utils.js:69:45)
    at eval (eval at compile (/home/runner/work/mineflayer-web-inventory/mineflayer-web-inventory/node_modules/protodef/src/compiler.js:258:12), <anonymous>:631:67)
    at eval (eval at compile (/home/runner/work/mineflayer-web-inventory/mineflayer-web-inventory/node_modules/protodef/src/compiler.js:258:12), <anonymous>:641:13)
    at eval (eval at compile (/home/runner/work/mineflayer-web-inventory/mineflayer-web-inventory/node_modules/protodef/src/compiler.js:258:12), <anonymous>:768:11)
    at Object.packet_declare_commands (eval at compile (/home/runner/work/mineflayer-web-inventory/mineflayer-web-inventory/node_modules/protodef/src/compiler.js:258:12), <anonymous>:773:9)
    at eval (eval at compile (/home/runner/work/mineflayer-web-inventory/mineflayer-web-inventory/node_modules/protodef/src/compiler.js:258:12), <anonymous>:2162:72)
    at packet (eval at compile (/home/runner/work/mineflayer-web-inventory/mineflayer-web-inventory/node_modules/protodef/src/compiler.js:258:12), <anonymous>:2253:9)
    at CompiledProtodef.read (/home/runner/work/mineflayer-web-inventory/mineflayer-web-inventory/node_modules/protodef/src/compiler.js:70:12)
    at e.message (/home/runner/work/mineflayer-web-inventory/mineflayer-web-inventory/node_modules/protodef/src/compiler.js:111:49)
    at tryCatch (/home/runner/work/mineflayer-web-inventory/mineflayer-web-inventory/node_modules/protodef/src/utils.js:50:16)
    at CompiledProtodef.parsePacketBuffer (/home/runner/work/mineflayer-web-inventory/mineflayer-web-inventory/node_modules/protodef/src/compiler.js:111:29)
    at FullPacketParser.parsePacketBuffer (/home/runner/work/mineflayer-web-inventory/mineflayer-web-inventory/node_modules/protodef/src/serializer.js:68:23)
    at FullPacketParser._transform (/home/runner/work/mineflayer-web-inventory/mineflayer-web-inventory/node_modules/protodef/src/serializer.js:74:21)
    at FullPacketParser.Transform._read (/home/runner/work/mineflayer-web-inventory/mineflayer-web-inventory/node_modules/readable-stream/lib/_stream_transform.js:177:10)
    at FullPacketParser.Transform._write (/home/runner/work/mineflayer-web-inventory/mineflayer-web-inventory/node_modules/readable-stream/lib/_stream_transform.js:164:83)
    at doWrite (/home/runner/work/mineflayer-web-inventory/mineflayer-web-inventory/node_modules/readable-stream/lib/_stream_writable.js:409:139)
    at writeOrBuffer (/home/runner/work/mineflayer-web-inventory/mineflayer-web-inventory/node_modules/readable-stream/lib/_stream_writable.js:398:5)
    at FullPacketParser.Writable.write (/home/runner/work/mineflayer-web-inventory/mineflayer-web-inventory/node_modules/readable-stream/lib/_stream_writable.js:307:11)
    at Decompressor.ondata (/home/runner/work/mineflayer-web-inventory/mineflayer-web-inventory/node_modules/readable-stream/lib/_stream_readable.js:681:20)
    at Decompressor.emit (events.js:400:28)
    at addChunk (/home/runner/work/mineflayer-web-inventory/mineflayer-web-inventory/node_modules/readable-stream/lib/_stream_readable.js:298:12)
    at readableAddChunk (/home/runner/work/mineflayer-web-inventory/mineflayer-web-inventory/node_modules/readable-stream/lib/_stream_readable.js:280:11)
    at Decompressor.Readable.push (/home/runner/work/mineflayer-web-inventory/mineflayer-web-inventory/node_modules/readable-stream/lib/_stream_readable.js:241:10)
    at Decompressor.Transform.push (/home/runner/work/mineflayer-web-inventory/mineflayer-web-inventory/node_modules/readable-stream/lib/_stream_transform.js:139:32)
    at Unzip.cb (/home/runner/work/mineflayer-web-inventory/mineflayer-web-inventory/node_modules/minecraft-protocol/src/transforms/compression.js:69:14)
    at Unzip.zlibBufferOnEnd (zlib.js:158:10)
    at Unzip.emit (events.js:400:28)
    at endReadableNT (internal/streams/readable.js:1334:12)
    at processTicksAndRejections (internal/process/task_queues.js:82:21)

Only happens with Minecraft 1.18.2 and doesn't appear to stop mineflayer nor mineflayer-web-inventory from working

bot crashes if it has items when no Minecraft version in bot is specified

Web Inventory only works when the bot has no items. If it has an item it crashes.
I tried it on Minecraft 1.18.2

Error message

mineflayer-web-inventory error. trying to continue
TypeError: mcData.version.<= is not a function
    at addItemData (C:\projects\discord-minecraft-bot\node_modules\mineflayer-web-inventory\utils.js:47:29)
    at emitWindow (C:\projects\discord-minecraft-bot\node_modules\mineflayer-web-inventory\index.js:96:40)
    at Namespace.<anonymous> (C:\projects\discord-minecraft-bot\node_modules\mineflayer-web-inventory\index.js:103:5)
    at Namespace.emit (node:events:527:28)
    at C:\projects\discord-minecraft-bot\node_modules\socket.io\dist\namespace.js:135:27
    at processTicksAndRejections (node:internal/process/task_queues:78:11)
C:\projects\discord-minecraft-bot\node_modules\mineflayer-web-inventory\utils.js:82
  if ((itemMaxDurability = mcData.itemsByName[item.name].maxDurability) && item.durabilityUsed != null) {
                                             ^

TypeError: Cannot read properties of undefined (reading 'azure_bluet')
    at addItemData (C:\projects\discord-minecraft-bot\node_modules\mineflayer-web-inventory\utils.js:82:46)
    at emitWindow (C:\projects\discord-minecraft-bot\node_modules\mineflayer-web-inventory\index.js:96:40)
    at Namespace.<anonymous> (C:\projects\discord-minecraft-bot\node_modules\mineflayer-web-inventory\index.js:103:5)
    at Namespace.emit (node:events:527:28)
    at C:\projects\discord-minecraft-bot\node_modules\socket.io\dist\namespace.js:135:27
    at processTicksAndRejections (node:internal/process/task_queues:78:11)

Mineflayer versions:

    "minecraft-assets": "^1.9.0",
    "minecraft-data": "^3.5.0",
    "mineflayer": "^4.3.0",
    "mineflayer-armor-manager": "^1.4.2",
    "mineflayer-pathfinder": "^2.1.1",
    "mineflayer-pvp": "^1.2.1",
    "mineflayer-web-inventory": "^1.8.2"

On install prod dependencies breaks the installatión

Hello i found a bit glitch,

On my project when i'm going to install only production dependencies only, this packages breaks the installation:

image

This package is in production dependencies because I use them in prod
image

CORS error on 1.6.0

Hello after update to 1.6.0 (from 1.4.0) I have CORS error when load .css and .js files

Also i see soem files not found

image

image

*I have updated mineflayer to laetst version 3.9.0

Item deposit failing

When having mineflayer-web-inventory open in your browser, trying to deposit items to chests fails.
I'd recommend fixing this as new mineflayer developers (like myself) will doubt their mental sanity after failing to copy an example multiple times :D

Code to reproduce:
let chest = bot.blockAt(new Vec3(96, 80, 130)) bot.openChest(chest).then((inventory) => { inventory.deposit(621, null, 64).then(() => inventory.close()) })

Stacktrace:

    at clickDest (C:\Users\Constantin Schreiber\WebstormProjects\minecraft_storage_bot\node_modules\mineflayer\lib\plugins\inventory.js:223:51)
    at transferOne (C:\Users\Constantin Schreiber\WebstormProjects\minecraft_storage_bot\node_modules\mineflayer\lib\plugins\inventory.js:220:13)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async transfer (C:\Users\Constantin Schreiber\WebstormProjects\minecraft_storage_bot\node_modules\mineflayer\lib\plugins\inventory.js:203:5)
    at async C:\Users\Constantin Schreiber\WebstormProjects\minecraft_storage_bot\node_modules\mineflayer\lib\plugins\inventory.js:292:7
    at emitUnhandledRejectionWarning (internal/process/promises.js:168:15)
    at processPromiseRejections (internal/process/promises.js:247:11)
    at processTicksAndRejections (internal/process/task_queues.js:94:32)
(node:1756) TypeError: Cannot read property 'type' of null
    at clickDest (C:\Users\Constantin Schreiber\WebstormProjects\minecraft_storage_bot\node_modules\mineflayer\lib\plugins\inventory.js:223:51)
    at transferOne (C:\Users\Constantin Schreiber\WebstormProjects\minecraft_storage_bot\node_modules\mineflayer\lib\plugins\inventory.js:220:13)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async transfer (C:\Users\Constantin Schreiber\WebstormProjects\minecraft_storage_bot\node_modules\mineflayer\lib\plugins\inventory.js:203:5)
    at async C:\Users\Constantin Schreiber\WebstormProjects\minecraft_storage_bot\node_modules\mineflayer\lib\plugins\inventory.js:292:7
(node:1756) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
    at emitDeprecationWarning (internal/process/promises.js:180:11)
    at processPromiseRejections (internal/process/promises.js:249:13)
    at processTicksAndRejections (internal/process/task_queues.js:94:32)

Error when opening the web gui

I got this error when I opened the web gui once. I think the bot had iron ingots and sheers in its inventory. Maybe there is a validations check missing somewhere?

/home/auditman/NodeJS/mineflayer-auto-shepherd/node_modules/mineflayer-web-inventory/utils.js:53
      rawMcData.legacy.pc.items[item.type + ':' + item.metadata].substr('minecraft:'.length)
                                                                 ^
TypeError: Cannot read properties of undefined (reading 'substr')
    at addTexture (/home/auditman/NodeJS/mineflayer-auto-shepherd/node_modules/mineflayer-web-inventory/utils.js:53:66)
    at emitWindow (/home/auditman/NodeJS/mineflayer-auto-shepherd/node_modules/mineflayer-web-inventory/index.js:96:40)
    at Namespace.<anonymous> (/home/auditman/NodeJS/mineflayer-auto-shepherd/node_modules/mineflayer-web-inventory/index.js:103:5)
    at Namespace.emit (node:events:526:28)
    at /home/auditman/NodeJS/mineflayer-auto-shepherd/node_modules/socket.io/dist/namespace.js:135:27
    at processTicksAndRejections (node:internal/process/task_queues:78:11)

Implement the click and moving logic

It would be useful to be able to click and move the items to reorganize the bot inventory, craft or even drop the items. This shouldn't be too hard to implement with mineflayer.

Add supports for behind proxy

Hello i'm trying to make a dynamic proxy to avoid open multiple ports for multiple bots,

But I saw some files can't be added in behind proxy, seems is a wrong method declaration

image

image

does multiple bot support

Can multiple bot instances be supported? like using the same port 80 and using different web paths to view them

Improve relative urls

Due to the path option we expose we can't use absolute paths to get the static files, as we want the static directory (the one that holds js, css, html and the inventory images) to be under the path specified by the user. This forces us to make some ugly things:

<script>
// Redirect so we can use relative paths
if (!document.location.href.endsWith('/')) document.location.href = document.location.href + '/'
</script>

I haven't been able to recreate, but apparently users can have problems with this: https://discord.com/channels/413438066984747026/413438150594265099/872460404956201020
Users with this problem can use the remove-path branch and thus without relative urls npm i https://github.com/imharvol/mineflayer-web-inventory.git#remove-path

We could also host the static files on /public, but that may cause interference with the user's public files

Throttle functions

  • Right now the server sends a socket packet every time the inventory updates. Instead we could just send an array with the updates.
  • Something similar happens with the client calling the function drawInventory() every times it receives an inventory update.

An solution would be to use lodash _.throttle() function

Cannot find package 'mineflayer-web-inventory' imported from (On python)

web-inventory doesnt works on python
image

Requires in my code:
mineflayer = require('mineflayer')
pathfinder = require('mineflayer-pathfinder')
movements = require('mineflayer-pathfinder').Movements
GoalNear = require('mineflayer-pathfinder').goals
inventoryViewer = require('mineflayer-web-inventory')
pvp = require('mineflayer-pvp').plugin

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.