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

Add anvil saver example #1222

Merged
merged 1 commit into from
Aug 9, 2020
Merged

Add anvil saver example #1222

merged 1 commit into from
Aug 9, 2020

Conversation

rom1504
Copy link
Member

@rom1504 rom1504 commented Aug 9, 2020

@rom1504 rom1504 requested a review from Karang August 9, 2020 01:19
const nbt = require('prismarine-nbt')
const Block = require('prismarine-block')(version)
const Chunk = require('prismarine-chunk')(version)
const ChatMessage = require('prismarine-chat')(version)
const World = require('prismarine-world')(version)
bot.world = new World().sync
bot.world = new World(null, storageBuilder ? storageBuilder({ version: bot.version, worldName: 'overworld' }) : null).sync
Copy link
Contributor

Choose a reason for hiding this comment

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

What happen if we move to nether or the end ? Should a single World instance deal with all dimensions ?

Copy link
Member Author

Choose a reason for hiding this comment

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

That's in the respawn line in blocks.js, a new world instance is created. worldName will be nether in this case
That's why storageBuilder is a function, so you can call it several time.
One world should handle only one dimension imho

(but indeed I actually hardcoded overworld in blocks.js, will add at least nether)

@rom1504 rom1504 merged commit 2ddb344 into master Aug 9, 2020
@rom1504 rom1504 deleted the anvil_example branch August 9, 2020 14:20
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.

2 participants