[1.21] Update wasTouchingWater
flag again
#1586
Open
+37
−15
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.
Hello once again!
As people are probably well aware of by now, I'm working on a Betweenlands port. Betweenlands has a "swamp water" fluid that is mostly similar to vanilla water, but I can't use vanilla water for a few various reasons unrelated to this discussion. I noticed while working through the fluid logic that there was no way to get vanilla aquatic animals to swim in this water. I tracked down the issue and found it was related to the
isInWater
method in the entity class, which uses thewasTouchingWater
boolean. This boolean will never be set to true if the entity is not in vanilla water. Now, the method responsible for changing this uses the vanilla water tag, but for some reason, Neo changes the tag check to simply just be a fluid type check. I'm not quite sure why this is, so I created a PR to somewhat change it back.I am very aware this is a breaking change, however I didn't know a good way of doing this without it being breaking. I'm happy to wait until 1.21.2 to get this merged, I would just like to let
isInWater
actually work with my water fluid without mixins. I also wanted to take the least intrusive patch route and figured this was the best way since it was already patched territory.If using the vanilla tag is a bad idea for this, please let me know and I can change it to be the neo tag or even a custom one. Also feel free to let me know if there's better ways to approach this and I can look into them. Thanks for listening!