Applied-Energistics-2 icon indicating copy to clipboard operation
Applied-Energistics-2 copied to clipboard

Replace raw long counting with a Long2LongMap accumulator

Open cplir-c opened this issue 1 year ago • 7 comments

Attempts to fix the fluid using 1 Bucket = 81k items issue.

I chose to use a Long2LongMap accumulator so that different AEKeyTypes with the same denominator could be summed in the same map slot, and avoid the internal-rounding issues that would be had if I divided all the values by their Unit denominators.

cplir-c avatar Jul 18 '24 16:07 cplir-c

We greatly prefer PRs like these to be submitted against the main branch targeting the latest version and not any previous version branches.

62832 avatar Jul 18 '24 17:07 62832

Seems it didn't help... still getting 81k

cplir-c avatar Jul 18 '24 17:07 cplir-c

Tested using a water bucket -> lava bucket pattern that just goes into a trashing matter condenser. I requested 2 buckets and gave it 1 lava bucket. Image

cplir-c avatar Jul 18 '24 17:07 cplir-c

I'll try some more tomorrow. Would it be ok for me to get it working first and then import the changes to 1.20.4 and 1.21?

cplir-c avatar Jul 18 '24 17:07 cplir-c

I would do it using floating point numbers.

Technici4n avatar Aug 01 '24 21:08 Technici4n

Generally for progress scaling, we can use the transfer unit we have in the key type (That is what we use to determine a how much a unit of work is for a given type of resource)

shartte avatar Aug 01 '24 21:08 shartte

I would do it using floating point numbers.

Alternatively, we may scale up the item type by AEFluidType.getAmountPerUnit() And then on GUI scale down. This can keep it int type, and more importantly, as financial programmers usually do, using int type will keep computing precise.

Simba98 avatar Aug 27 '24 03:08 Simba98