Code Monkey home page Code Monkey logo

Comments (15)

minidogg avatar minidogg commented on June 15, 2024 6

is this done yet?

from bedrock-protocol.

rom1504 avatar rom1504 commented on June 15, 2024 5

pitem bedrock is done

from bedrock-protocol.

extremeheat avatar extremeheat commented on June 15, 2024 4

Some notes from discord discussion:

  • prismarine-entity will likely need some changes to make it consistent across all versions (like effects, attributes, properties)
    • After looking at prismarine-physics/entity, one of the things we can do I think is make the effect/attribute/entity names consistent across all versions, that would simplify the code alot and remove alot of code like this: https://github.com/PrismarineJS/prismarine-physics/blob/708ff2341bbe8e542f9d29a82c9c102c33a02c02/index.js#L649
    • since effectNamesAreRegistryNames is only valid on pc1.17, mc-data can probably be updated to rename the effects to 1.19/1.16 naming. A protocolName field could be added to keep the actual protocol naming instead so name can be consistent across all pc versions / bedrock versions

Prismarine item will require loading item palette data from StartGame packet similar to pc dimension codec. Some work in PrismarineJS/prismarine-registry#26 (comment). Enchant data was added in PrismarineJS/minecraft-data#689, so all the data for pitem should now be in place.

Additionally, prismarine window handling will also likely require some changes to pitem

from bedrock-protocol.

extremeheat avatar extremeheat commented on June 15, 2024 3

Remaining work backlog

What's done

  • PrismarineJS/bedrock-provider#9 - support for 1.18 level format
  • mc-data updated with most essential data, biomes, blocks, items, collisions, etc.
  • prismarine-viewer kind of works, but needs some updates to block model mapping

Non-essential backlog

from bedrock-protocol.

extremeheat avatar extremeheat commented on June 15, 2024 3

June 2022

Remaining work backlog

What's done

Non-essential backlog

Want to help?

  • Get a good understanding of how the prismarine projects work currently, specifically mineflayer.
  • Then take a look at the bedrock protocol documentation (on https://minecraft-data.prismarine.js.org)
  • use a bedrock-protocol proxy (called Relay) over a vanilla server and client to understand how the packets are used in correlation to ingame activity
  • Update packages in Remaining work backlog to implement in game features (the packages provide abstraction on topp of the game protocol)

from bedrock-protocol.

rom1504 avatar rom1504 commented on June 15, 2024 2

I think it would be great to get this one moving.

I wonder if we could do a minimal implementation in mineflayer with some basic stuff working (chat) and have the rest not work, and go from there

I think that may be a better approach than blocking on "be on par with pc"

from bedrock-protocol.

extremeheat avatar extremeheat commented on June 15, 2024 1

Progress Report, (trying to finally get this bedrock stuff out of the way)

  • PrismarineJS/minecraft-data#445 has been opened to move the protocol data to minecraft-data, #115 will implement it here in bedrock-protocol, with PrismarineJS/node-minecraft-data#110
  • prismarine-block support in PrismarineJS/prismarine-block#40
  • prismarine-item is blocked by PrismarineJS/prismarine-item#38 to avoid a conflict
  • the easy approach to pchunk for now I think is to depend on bedrock-provider (it doesn't depend on leveldb anymore), I'll have something to update it to update it to 1.17.10 + new prismarine-block later this week
  • prismarine-recipes support for bedrock recipe schema in PrismarineJS/prismarine-recipe#9
    • main difference in the schema is "ingredients" is always set as a flat array, with indexes for the shapes in the "inputs" field.
    • This also uses strings when addressing items as there are no hardcoded item IDs on bedrock.
    • We could make it more conformant to the PC schema (it was just easier to code with this schema), but after implementing it in prismarine-recipie imo I think it's alot easier keeping it this way

For consideration:

  • New lib to do inventories and/or expand scope of p-windows ?
    • Inventory logic needs to be shared between the client and the server, and nickelpro is also working on revamping java edition inventories for pc 1.17.
    • https://extremeheat.github.io/bedrock-protocol/protocol/1.16.220.html#ItemStackRequest - on bedrock, the inventory actions are high level instead of being click based, so actions like take, place, swap, etc. are sent instead of individual clicks.
    • Clients can also batch inventory requests (e.g. click spreading in one packet), so it needs to be able to simulate these requests from the server. If the server rejects, client needs to discard and undo the batch.

from bedrock-protocol.

u9g avatar u9g commented on June 15, 2024

In terms of inventory, nickelpro was talking about a similar way to do high level actions with p-window where you would be able to say window.swap(itemOne, itemTwo) and everything with slots would be handled by p-window

from bedrock-protocol.

extremeheat avatar extremeheat commented on June 15, 2024

Yeah, that could be joined along with a transaction group API to batch many actions at once. Something like this is also needed for GUI inventories in Minecraft, and I've implemented it into minecraft-inventory-gui for creative mode (just not connected to network APIs) : https://github.com/extremeheat/minecraft-inventory-gui/blob/bedrock/web/CW2.js

For example, doing spread operations in the inventory, then cancelling it requires the client to simulate the spread, then if not cancelled, send the group to the server for confirmation (or rejection).

For the mineflayer side an API like this :

interface Inventory {
  // take from slot and put count into hand
  take({ from?: string, fromSlot?: number, count?: number })
  // take item from slot and put count into hand
  take({ from?: string, item?: ItemName, count?: number })
  // place from hand to slot specific if slot is specified, else distribute
  place({ toSlot?: number, count?: number })
  // move from slot to another slot
  move({ from?: string, fromSlot?: number, to?: string, toSlot?: number })
  // from item from one place to another place (specific slot if specified)
  move({ from?: string, item?: number, to?: string, toSlot?: number })
}
const tx = bot.inventory.startTransaction()
tx.take({ fromSlot: 0, count }) // put into hand
tx.place({ toSlot: 0, count }) // put from hand into slot
tx.swap({ fromSlot: 0, toSlot: 1 })
tx.move({ from: 'chest', fromSlot: 2, to: 'hand' })
tx.send()

There some duplicates APIs which do the same thing, I just added them from the bedrock protocol. For automation in agents, the action space can be simplified to just moving x item to y.

from bedrock-protocol.

u9g avatar u9g commented on June 15, 2024

prismarine-item pr has been merged

from bedrock-protocol.

RUGMJ avatar RUGMJ commented on June 15, 2024

Any updates?

from bedrock-protocol.

neohunter avatar neohunter commented on June 15, 2024

PrismarineJS/mineflayer#2411

How to make mineflayer use bedrock-protocol instead of minecraft-protocol?

from bedrock-protocol.

rom1504 avatar rom1504 commented on June 15, 2024

by finishing this task, if you want to help @neohunter feel free to join #bedrock-protocol in discord and ask what you can do at this time to make things easier

from bedrock-protocol.

ATXLtheAxolotl avatar ATXLtheAxolotl commented on June 15, 2024

What problems are there currently with prismarine-physics that prevents it from supporting bedrock?

from bedrock-protocol.

extremeheat avatar extremeheat commented on June 15, 2024

What problems are there currently with prismarine-physics that prevents it from supporting bedrock?

Problems if any for physics will come up when making tests for it on bedrock to see what works / what needs changes

from bedrock-protocol.

Related Issues (20)

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.