Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement ElapsedTimeTracker to support AEKeyType AmountPerUnit scaling #8170

Closed
wants to merge 2 commits into from

Conversation

Simba98
Copy link
Contributor

@Simba98 Simba98 commented Aug 27, 2024

Implement #7321, and replace #8045.

This is by adding internal scaling to keep the tracker as an integer.

Possible issue: broken changes due to NBT data in the disk may be invalid.

@Simba98
Copy link
Contributor Author

Simba98 commented Sep 18, 2024

Updated to newest commit

@62832
Copy link
Member

62832 commented Sep 18, 2024

Please run the spotlessApply Gradle task for proper code formatting and for the automated build to pass.

@Simba98
Copy link
Contributor Author

Simba98 commented Sep 19, 2024

Please run the spotlessApply Gradle task for proper code formatting and for the automated build to pass.

Hi 62832, thanks for reminding me. I have applied the spotless format check and passed the checks.
And also there is a back port for 1.20.1 on #8171

}

public long getStartItemCount() {
return this.startItemCount;
return Math.round(((float) this.startItemCount) / AEKEY_SCALE_FACTOR);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just use integer division here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just use integer division here?

Integer Division equals Math.floor, making the 99/10 = 9 instead of 10 in this case.
I want to round to make it more precise in displaying, for showing progress, the trade-off is performance.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want to simulate math.round() with integer division you can add half of the AE_SCALE_FACTOR before dividing, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want to simulate math.round() with integer division you can add half of the AE_SCALE_FACTOR before dividing, right?

You are right. I have updated.

@Simba98 Simba98 requested a review from cplir-c September 26, 2024 06:37
@shartte
Copy link
Member

shartte commented Dec 7, 2024

This doesn't actually work for me , it continually shows "0 crafted" when crafting water in the test world.

@shartte
Copy link
Member

shartte commented Dec 7, 2024

I am changing this to sync the percentage to clients and internally track the work by type...

image

@shartte
Copy link
Member

shartte commented Dec 7, 2024

Since you didn't enable the checkbox to allow comitters access, I'll have to open my own PR with the changes

@shartte shartte closed this Dec 7, 2024
@shartte
Copy link
Member

shartte commented Dec 7, 2024

Opened #8266 with the changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants