-
Notifications
You must be signed in to change notification settings - Fork 899
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
Underwater visibility is increased even if the player is not wearing a Diving Helmet #4826
Comments
Same here! |
Also getting this with 0.5.1b. |
Ah, hope someone is already trying to fix this, otherwise i will maybe try to fix it in like half a week. |
You can try to find out the buggy mod using binary search, especailly when there's a large number of them. |
This is actually incredibly easy to solve, it requires changing a single line of code. At line 320 in the ClientEvents.java where it says: if (FluidHelper.isWater(fluid). The fix is to add a condition for the helmet. I don't really work with Java so there may be a better way to fix the problem overall, but I personally have just added a check for the Copper Diving Helmet. This is what the fixed portion of code looks like:
An even better fix might look something like this, but I haven't tested this personally:
This can be specifically located here:
|
Damn you're the goat! |
please fix :( |
The third line off @PotionSeeker 's better fix should be if (FluidHelper.isWater(fluid) && (AllItems.COPPER_DIVING_HELMET.isIn(divingHelmet) || AllItems.NETHERITE_DIVING_HELMET.isIn(divingHelmet))) because that expression is true if [fluid is water and (wearing copper diving helmet or wearing netherite diving helmet)]. |
This was fixed yesterday in commit a947a06. |
Describe the Bug
Wearing a Diving Helmet usually increases the distance of the underwater fog and allows the player to see further. However, since Create 0.5.1a, the visibility underwater is always increased no matter what the player is wearing in their head slot (even if the slot is empty). This issue occurs on both 1.18.2 and 1.19.2.
Reproduction Steps
Expected Result
The distance of the underwater fog should only be increased when wearing a Diving Helmet.
Screenshots and Videos
Water fog without Create installed:
Water fog with Create installed:
Crash Report or Log
No response
Operating System
Windows 11
Mod Version
0.5.1b
Minecraft Version
1.19.2
Forge Version
43.2.3
Other Mods
This issue occurs with only Create installed.
Additional Context
Towards the end of the
getFogDensity
method in theClientEvents
class,DivingHelmetItem.getWornItem()
is called, which returns the ItemStack in the entity's head slot. There is no check for what item this ItemStack is before modifying the water fog distance. There is only a null check, butDivingHelmetItem.getWornItem()
only returns null if the entity is not aLivingEntity
. This issue does not affect lava fog because there is a check if the ItemStack is a Netherite Diving Helmet before modifying the lava fog distance.The text was updated successfully, but these errors were encountered: