-
-
Notifications
You must be signed in to change notification settings - Fork 420
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
vclip up/down integration with jesus hack #877 #887
Closed
DottorManu
wants to merge
1
commit into
Wurst-Imperium:master
from
DottorManu:vclip-up/down-integration-with-jesus-hack-#877
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The while loop here could potentially lead to an infinite loop if the
isOverLiquid
method always returns true. Consider adding a maximum limit to the number of iterations or a timeout to prevent this.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. Also the
vclip()
method seems like the wrong place to put a check like this. It would completely ignore existing block collision checks and change the height even if the user requested an exact number (e.g. by typing.vclip 5
).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Alexander01998: You're correct. The current implementation could potentially override the user's input and cause unexpected behavior. A better approach might be to separate the logic for the 'JesusHack' feature from the 'vclip' command. This way, the 'vclip' command can maintain its original functionality, and the 'JesusHack' feature can be applied separately when needed.
Here's a possible solution:
In this solution, the 'vclip' command will always teleport the player by the specified height. If the 'JesusHack' feature is enabled, the player's position will be further adjusted to stay above any liquid blocks. This adjustment is done in a separate method to keep the 'vclip' method simple and focused on its main task. The 'adjustForJesusHack' method includes a limit on the number of iterations to prevent potential infinite loops.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, not like that.
VClipCmd
has a separatehasCollisions()
method that's made for this purpose. Actually, looking at the code, that method already does basically the same thing as Jesus. I wonder why that wouldn't teleport the player above liquids. @nobotreplyThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.