Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use prismarine-world #1145

Merged
merged 9 commits into from
Aug 9, 2020
Merged

use prismarine-world #1145

merged 9 commits into from
Aug 9, 2020

Conversation

rom1504
Copy link
Member

@rom1504 rom1504 commented Jul 13, 2020

No description provided.

@rom1504
Copy link
Member Author

rom1504 commented Jul 13, 2020

next steps of this plan :

  • 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)
  • make the viewer use prismarine-world only
  • create an example showing how to save a mineflayer world to anvil (rendered trivial by using prismarine-world)

@rom1504
Copy link
Member Author

rom1504 commented Jul 13, 2020

Then (from @Karang )

(this can be done in other PRs, I may copy this content to an issue later)

@rom1504
Copy link
Member Author

rom1504 commented Jul 13, 2020

PrismarineJS/prismarine-world#42 is required so tests won't fail because we don't have anvil support for all versions


const column = columns[key]
const column = bot.world.sync.getColumnAt(loc.chunkCorner.x, loc.chunkCorner.z)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should be able to use directly:

const block = bot.world.sync.getBlock(absolutePoint)

also, I think that pworld should do the line:

block.position = loc.floored

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah totally, I was mainly trying to make as little change as possible while making it works
I'll clean this up

lib/plugins/blocks.js Outdated Show resolved Hide resolved
@rom1504
Copy link
Member Author

rom1504 commented Jul 27, 2020

Yeah didn't have time to continue this. I think it's quite doable, must be just a small detail that isn't right

@rom1504 rom1504 force-pushed the pworld branch 4 times, most recently from 2d52c7c to 5f51042 Compare August 8, 2020 21:48
@rom1504
Copy link
Member Author

rom1504 commented Aug 8, 2020

needed to merge this:

  • fix tests
  • update viewer (_columns is gone)
  • reviews

@rom1504
Copy link
Member Author

rom1504 commented Aug 9, 2020

After the followup on this, bot.blockAt will be deprecated, bot.world.getBlock should be used. (that'll be when everything of the world is ported to prismarine-world)

@rom1504
Copy link
Member Author

rom1504 commented Aug 9, 2020

Ok fixed the tests
Could you review @Karang ?
The idea here is to introduce prismarine-world.
To fully take advantage of it, I put the follow up at #334 (comment)

Copy link
Contributor

@Karang Karang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, left 2 minor comments.

lib/plugins/blocks.js Outdated Show resolved Hide resolved
lib/plugins/blocks.js Outdated Show resolved Hide resolved
@rom1504 rom1504 merged commit e81bbd0 into master Aug 9, 2020
@rom1504 rom1504 deleted the pworld branch August 9, 2020 01:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants