PrismarineJS/mineflayer

Move the whole world state to prismarine-world for better packaging #334

rom1504 posted onGitHub

This will make blockAt async and break everything depending on it. But it's for the good cause of being able to implement a world representation with any kind of backend (especially async backend like databases)

https://github.com/PrismarineJS/prismarine-world

https://github.com/andrewrk/mineflayer/blob/master/lib/plugins/blocks.js


https://github.com/PrismarineJS/mineflayer/pull/1145 made this happen

Follow up :

  • create an example showing how to save a mineflayer world to anvil (rendered trivial by using prismarine-world)
  • Some events, world is already an EventEmitter, but no events are emitted (blockUpdate, chunkColumnLoad/Unload, etc..) eventually those events could be removed or proxyed in mineflayer
  • store signs paintingsByPos and paintingsById in prismarine-world (/chunk)
  • A way to store block entities https://github.com/PrismarineJS/mineflayer/blob/master/lib/plugins/blocks.js#L27 it would make sense to have it directly in prismarine-chunks similar to what mojang do (would simplify things for storing chunks), but that could go first in prismarine-world
  • deprecate bot.blockAt , bot.world.getBlock should be used. (that'll be when everything of the world is ported to prismarine-world)
  • move find block to somewhere outside of mineflayer, so it can be used with any prismarine-world (either its own package, either directly in prismarine-world)
  • entities ? If we want to be able to use only pworld in pviewer, we also need the world to emit entity related events: https://github.com/PrismarineJS/prismarine-viewer/blob/master/lib/mineflayer.js#L82
  • make the viewer use prismarine-world only
posted by rom1504 over 4 years ago

deprecating blockAt would be really useful

posted by rom1504 over 4 years ago

@rom1504 has funded $10.00 to this issue.


posted by issuehunt-app[bot] over 4 years ago

Faced with the fact that mineflayer duplicates some things from prusmarine such as Block, Item, Recipe, etc. Is it about reusing all of this from prismarine? And what remains to be done on this task?

posted by introquest over 4 years ago

@introquest Mineflayer does not duplicate anything from those libraries, but imports then. The goal of Mineflayer is to move as much code out of Mineflayer as possible into micro-modules. (prismarine-block, primsarine-item, etc) Ideally, by making many very small libraries, they become very easy to maintain and reuse since they are so small.

As for this issue, prismarine-world should contain all of the world states, with Mineflayer acting solely as a stateless transformer for the world. The world contains submodules that further divide the state. Prismarine-chunk, Prismarine-Entity, etc.

posted by TheDudeFromCI over 4 years ago

@sauberesache has funded $20.00 to this issue.


posted by issuehunt-app[bot] about 4 years ago

@sauberesache has cancelled funding for this issue.(Cancelled amount: $20.00) See it on IssueHunt

posted by issuehunt-app[bot] over 3 years ago

@rom1504 has cancelled funding for this issue.(Cancelled amount: $10.00) See it on IssueHunt

posted by issuehunt-app[bot] over 3 years ago

Fund this Issue

$0.00
Funded
Only logged in users can fund an issue

Pull requests

Recent activities

rom1504 cancelled funding 10.00 for  PrismarineJS/ mineflayer#334
over 3 years ago
sauberesache cancelled funding 20.00 for  PrismarineJS/ mineflayer#334
over 3 years ago