Open wsor4035 opened 3 years ago
This is intentional, the property is used for physics stuff like buoyancy, and for swimming, things that shouldn't happen in flowing liquid as it is. Maybe the name doesn't reflect that so well, but I like to keep names short.
ah, makes sense, is it possible then that self.isinflowingliquid could be implemented in the api then?
Sure it's possible, the question though is if it's worth it performance wise, because such parameters are evaluated every single step.
Can you describe an use case for this parameter?
Can you describe an use case for this parameter?
sure, here are a few, however they mainly fall into aquatic and non aquatic for aquatic you might want to kill the mob if it is out of water and out of flowing water, or in flowing water trigger a behavior to look for the nearest source block (because players or mapgens can make flowing rivers, or waterfalls, etc)
for non aquatic examples a mob might want to avoid flowing water as well as water sources, etc
@TheTermos bump on this if you dont mind
Ok, isinliquid is important for basic movement, that's why it's evaluated every step, and that's why it's as simple as a single point check.
For the things you mention, you need info about a volume of nodes, and you don't need to run it every step, it may be on demand or interval. Check function lava_dmg() in zombiestrd, might be what you're looking for.
suggestion that this should be changed to true if in source or flowing, however this might break mods that assume this so as a alternative self.isinflowingliquid could exist for liquid type = source