Giter Site home page Giter Site logo

Comments (8)

dorianpb avatar dorianpb commented on August 16, 2024

is_in_water checks if the entity's hitbox is fully submerged in water.

does it not work when the entity is fully submerged in water?

from cem.

MonsterTrex avatar MonsterTrex commented on August 16, 2024

Ah I see! Yes that does work! However, that is not how the Optifine code seems to treat that behaviour - Optifine's CEM checks whether or not the entity is touching water at all (rain doesn't count, just water sources and flow blocks).

Is there anyway to maybe apply this behaviour alongside what you currently have? For instance, when the mob is fully submerged - is_in_water - one form of an animation can be triggered, where as when the mob is simply touching a water block (ie. not fully submerged, but floating atop of water like most mobs do when jumping into an ocean to follow you), another animation can be presented.

Bearing this in mind... I had an idea of trying something along the lines of is_in_water>=0.1, but to probably no-one's surprise, that does not work as I assume this is a yes/no sort of value. Following this idea, I tried to potentially combine the idea of is_wet&&!is_on_ground and that does actually work to the criteria of the creature being afloat of water... but this does mean that when a creeper is falling from a block or jumps off from a cliff while it's also raining, he will switch to a swimming animation...

So... any ideas how I could get around this problem? Are there any booleans that could detect rain? I can't find anything related to this. But thankyou for clearing this up to begin with! It'd be useful if there's a way to make the entity recognise rain defined by a separate boolean, that way I could have a "swimming" animation AND a "floating atop water" animation. Any help will be greatly appreciated...

Now to test whether or not Optifine recognises these boolean combinations the same way this mod does...

[edit]: Just tested these booleans within Optifine and they don't seem to like the is_wet&&!is_on_ground combination when put up next to is_in_water boolean... So I'm a bit puzzled at this point what to do as both versions interact differently with the booleans...

from cem.

stale avatar stale commented on August 16, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs within 14 days. Thank you for your contributions.

from cem.

dorianpb avatar dorianpb commented on August 16, 2024

could you elaborate on the differences between optifine's booleans and this nods booleans?
how exactly are they different? I know you mentioned they behave differently but I'm having trouble understanding how...
They should behave the same since they check the same attribute on the actual entity

from cem.

MonsterTrex avatar MonsterTrex commented on August 16, 2024

To make it simple, Optifines CEM implementation of is_in_water checks whether or not the entity is touching a water block (whether that is a source blocks or not), in comparison to your implementation, which checks for if the entity is fully submerged under water.

from cem.

stale avatar stale commented on August 16, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs within 14 days. Thank you for your contributions.

from cem.

Best-JelloBeanz avatar Best-JelloBeanz commented on August 16, 2024

This sounds like a tough issue to crack, but then again I barely know simple code so everything code related is complicated to me

from cem.

stale avatar stale commented on August 16, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs within 14 days. Thank you for your contributions.

from cem.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.