ldtteam / Aequivaleo

Analysis engine and mediator mod for analyzing recipes and equivalencies of items, blockstates and other game objects in minecraft.
GNU General Public License v3.0
5 stars 4 forks source link

Fluid Values Not Propagating To Fluid Containers #19

Closed MercuriusXeno closed 3 years ago

MercuriusXeno commented 3 years ago

An itemstack container (such as a bucket) can contain a fluidstack.

You can generate values for the fluids, and the container item, but Aequivaleo doesn't see the relationship between a bucket, BUCKET_VOLUME of a fluid (like water), and a water bucket (the product of those two things).

At the moment you can teach it these relationships manually, either by directly giving the items a hand-crafted value, or by registering a recipe type and supplementing those compound types.

If we could take this a step further, and make Aeq innately aware that buckets can contain fluids, Aeq could infer the value of liquid-and-container combos automatically.

I'm not certain this should extend to all FluidHandlers; I think ideally this wouldn't affect complex handlers like custom mod tanks; strictly bucket-items that have a non-variable quantity of liquid as part of their identity as an item (buckets being a prime example). Probably needs more thought/discussion. Feel free to ping me if this needs better wording.

MercuriusXeno commented 3 years ago

Dumping some thoughts/notes from discord monologue in case they're helpful for reference.

I'm not thoroughly convinced the proposal I have in my head is rational.

I did some stuff in goo that infers that FluidHandlerCapable items have fluid in them, and gets the value of their fluids - but only if they're goo.

I could take that to a logical step forward by getting the Aeq value of the fluid inside, but the loss there is that you really want the contents of a bucket or fluid containing item to be its value when Aeq is doing its analysis

Such that, for example, a thing which used a water bucket in its recipe would know the result contained "a bucket-volume of water" value, whatever that value is.

Aeq is already smart about excluding the bucket from the results evaluation, but it does need to know that water exists in the equation

So, to explain another way - if I make it so that my cache grabber fetches the item's content's values (I see a lava bucket, I ask for lava's value, and infer the composite), I'm robbing Aeq of the knowledge that bucket contains lava, and the opportunity to use that in evaluations.

I THINK making Aeq FluidHandler aware is a slippery slope though, I'm not sure where you'd draw the line. I think some assembly is still required for dynamic storage items, like a portable tank. Because those don't have any sort of promise to contain a particular fluid, or a specific amount of it