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

Adds requestStatistics() promise. #1962

Closed
wants to merge 17 commits into from
Closed

Adds requestStatistics() promise. #1962

wants to merge 17 commits into from

Conversation

KaffinPX
Copy link
Contributor

@KaffinPX KaffinPX commented Jun 2, 2021

Closes #1732
Also adds a test and an example.

@KaffinPX
Copy link
Contributor Author

KaffinPX commented Jun 2, 2021

image

lib/plugins/statistics.js Outdated Show resolved Hide resolved
lib/plugins/statistics.js Outdated Show resolved Hide resolved
lib/plugins/statistics.js Outdated Show resolved Hide resolved
lib/plugins/statistics.js Outdated Show resolved Hide resolved
module.exports = () => async (bot) => {
const stats = await bot.requestStatistics()

assert.strictEqual(typeof stats, 'object')
Copy link
Member

Choose a reason for hiding this comment

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

definitely going to need more testing then that stats is an object

Copy link
Contributor Author

Choose a reason for hiding this comment

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

can u help me lol

Copy link
Member

Choose a reason for hiding this comment

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

Check the values

examples/statistics.js Show resolved Hide resolved
docs/api.md Show resolved Hide resolved
lib/features.json Outdated Show resolved Hide resolved
@u9g
Copy link
Member

u9g commented Jun 3, 2021

I refactored the code a bit and left a pr: https://github.com/Kaffidev/mineflayer/pull/1 , also, this is going to need to be abstracted if you look at whats printed in tests, imo the statistics need to be extracted from Burger and brought to mcData, where we can then use them in this pr

@KaffinPX
Copy link
Contributor Author

KaffinPX commented Jun 3, 2021

You are right, thanks for pr.

@rom1504
Copy link
Member

rom1504 commented Jun 16, 2021

test is useless, please fix

@u9g
Copy link
Member

u9g commented Jun 20, 2021

This shouldn't be merged until the necessary data is brought to mcData. The necessary data being the translation map from achievement category as a number to string and a class to unify this across versions. This requires the mcData part to be done thought.

@KaffinPX
Copy link
Contributor Author

This shouldn't be merged until the necessary data is brought to mcData. The necessary data being the translation map from achievement category as a number to string and a class to unify this across versions. This requires the mcData part to be done thought.

U9G is right, but im busy.

@rom1504
Copy link
Member

rom1504 commented Aug 7, 2021

too old, reopen if you want to finish

@rom1504 rom1504 closed this Aug 7, 2021
Chitasa pushed a commit to Chitasa/mineflayer that referenced this pull request Jun 8, 2023
@Chitasa Chitasa mentioned this pull request Jun 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Read Statistics using mineflayer.
3 participants