-
Notifications
You must be signed in to change notification settings - Fork 0
Threshold-Decay #6
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
base: 1.20-Forge
Are you sure you want to change the base?
Conversation
| */ | ||
| public void setKeyProgress(String key, ResourceType rt, float value) { | ||
| if (key == null || key.isEmpty()) return; | ||
| var byKey = keyProgress.computeIfAbsent(rt, __ -> new java.util.HashMap<>()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better to extract this line into a separate method because it repeats several times during this file and changes all other same occurences
It should be something like
| var byKey = keyProgress.computeIfAbsent(rt, __ -> new java.util.HashMap<>()); | |
| var byKey = getKeyProgressOrCreate(rt); |
| * Set the exact cursor value for a specific key/resource. | ||
| * If value <= EPS the key entry is removed. | ||
| */ | ||
| public void setKeyProgress(String key, ResourceType rt, float value) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has no usage, maybe you should remove it?
| var unit = Load.Unit(player); | ||
| if (unit != null) { | ||
| // Iterate only active keys per resource | ||
| for (var rt : com.robertx22.mine_and_slash.saveclasses.unit.ResourceType.values()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use an import instead
| for (var rt : com.robertx22.mine_and_slash.saveclasses.unit.ResourceType.values()) { | |
| for (var rt : ResourceType.values()) { |
| if (procs > 0) { | ||
| spec.onProc(sp, procs); | ||
| spec.startCooldown(unit, now); | ||
| if (spec.resetOnProc()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To match names of other methods
| if (spec.resetOnProc()) { | |
| if (spec.dropProgressOnProc()) { |
No description provided.