ExampleMod-1.12 icon indicating copy to clipboard operation
ExampleMod-1.12 copied to clipboard

A few issues with fluids

Open chylex opened this issue 6 years ago • 0 comments

Hi, just wanted to point out a few issues I found in some of the tutorials:

  1. When implementing the FogDensity event, never set the density to something like 0.0001F. If the player isn't inside the cloud dimension or slime liquid, don't cancel it, because that will break vanilla behavior (such as being inside water/lava), and potentially other mods that use the event. Similarly with the FogColors event, if you're not changing anything then don't set any default values (and probably don't use receiveCancelled).

  2. When you check if the player is inside the slime liquid on client side, vanilla does that using ActiveRenderInfo.getBlockStateAtEntityViewpoint. Using isInsideOfMaterial breaks third person view, and can cause issues when the player is extremely close to the liquid and rotates the camera.

  3. I noticed you use ReflectionHelper, especially for http://jabelarminecraft.blogspot.com/p/minecraft-modding-getting-air-supply.html - reflection is much slower than accessing the fields directly, please use an access transformer instead. (I also wouldn't recommend cancelling the LivingUpdateEvent and completely replacing it, it's always a pain to update to a new MC version; there must be a better way to implement drowning)

Thanks for the tutorials; they are really useful, hopefully you can update them to fix these issues because it could be a problem if someone just copy/pastes the code.

chylex avatar Oct 05 '18 23:10 chylex