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

Fix incorrect behavior in 1.19+. Improve feature list version condition. #110

Closed
wants to merge 2 commits into from

Conversation

szdytom
Copy link

@szdytom szdytom commented Nov 1, 2023

The problem: I have noticed the bot cannot climb trapdoors that is directly above ladders (#109). I have also noticed that in 1.20.1 the bot cannot jump to climb ladders (#108).

In this pull request:

  • I've added a new feature climableTrapdoor to indicate whether the trapdoors is climbable. Reference: Trapdoor History - Minecraft Wiki
  • I've added code in function isOnLadder to handdle trapdoors.
  • I've re-designed the format of versions field in featires.json (the new format is fully compatible with the old format).
  • I've added a new class called FeatureList that can parse the new format.
  • I've added testcases to test if FeatureList is working.

The new version format is described in the comments beside FeatureList source:

https://github.com/szdytom/prismarine-physics/blob/c524a9b0e655c472e1ecbb4f2193cb26360e8313/index.js#L7-L21

Fixes #108
Fixes #109

@extremeheat
Copy link
Member

There is already a feature file inside minecraft-data. It would make more sense to move the features there and use them inside prismarine-physics. There are some features that have disconnected version ranges. This was discussed earlier in another PR, it could instead be implemented with two features.

@szdytom
Copy link
Author

szdytom commented Nov 1, 2023

It seems that minecraft-data uses a array of 2 elements representing a range.

I am proposing a more complex yet powerful format of that. A range in this format can be: [[">= 1.12", "<= 1.14"]], with disconnected version ranges, it can be: [[">= 1.12", "<= 1.14"], [">= 1.16"]].

@szdytom
Copy link
Author

szdytom commented Nov 1, 2023

Anyway, I think whether to move the list to minecraft-data can be discussed later, maybe we can have the ladder behavior fixed for now?

@extremeheat
Copy link
Member

I am proposing a more complex yet powerful format of that

Yes, this change, if any, should not be done here, but rather in node-minecraft-data. We already are going to remove this, and I believe a previous PR to do this here went stale. So it should definitely not be updated further here.

@szdytom
Copy link
Author

szdytom commented Nov 1, 2023

Alright, I've just opened a pull request #111 on fixing ladders.

@szdytom szdytom closed this Nov 1, 2023
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.

Cannot climb trapdoors dirrectly above ladders Feature lists is not updated
2 participants