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

digTime wrong since 1.20.5 #102

Open
tabbry opened this issue Nov 2, 2024 · 3 comments · May be fixed by PrismarineJS/minecraft-data#943
Open

digTime wrong since 1.20.5 #102

tabbry opened this issue Nov 2, 2024 · 3 comments · May be fixed by PrismarineJS/minecraft-data#943

Comments

@tabbry
Copy link

tabbry commented Nov 2, 2024

Problem first discovered in mineflayer-tool when playing MC 1.20.6 as it was no longer able to determine the best tool, due to wrong digTime calculation. It seemed like it made the calculation for digTime = 900 for dirt no matter the tool.

Using following test by appending /test/basic.test.js revealed that the problem seems to have been introduced with 1.20.5 as 1.20.4 seems to just work fine.

describe('Dig time', () => {
  describe('1.20.5', () => {
    const registry = require('prismarine-registry')('1.20.5')
    const Block = require('prismarine-block')(registry)
    it('dig dirt (shovel faster than hand)', () => {
      const dirt = Block.fromStateId(registry.blocksByName.dirt.defaultState, 0)
      const shovel = registry.itemsByName.iron_shovel
      const handTime = dirt.digTime(null, false, false, false)
      const shovelTime = dirt.digTime(shovel.id, false, false, false)
      expect(shovelTime < handTime).toBeTruthy()
    })
  })
  ...
})
@rom1504
Copy link
Member

rom1504 commented Nov 2, 2024

that's probably due to incorrect data. Can you take a look @GroobleDierne ?

@tabbry can you open a PR with that test?

@rom1504 rom1504 pinned this issue Nov 2, 2024
tabbry pushed a commit to tabbry/prismarine-block that referenced this issue Nov 2, 2024
@tabbry tabbry mentioned this issue Nov 2, 2024
@tabbry
Copy link
Author

tabbry commented Nov 2, 2024

Thank you @rom1504 for checking my comment. I created a PR: #103. Please note, that this is my first PR in a public repo, in case I missed something...

@Madlykeanu
Copy link

image
it looks like the data generator may have been updated incorrectly, since it has all kinds of weird data in the extracted data when compared to 1.20.4 like "incorrect_for_x_tool"

image

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 a pull request may close this issue.

3 participants