Fix: Mana bar render & regen bugs#569
Conversation
|
The multiple resource render is not a perfect solution, and should be re-done. A better solution would be to remove the anchoring change within the bounding box, and make the bounding box more tight around the resource bars (currently there is some room on the right side). The resource bars can always start placement from top-left of their combined bounding box, as this increases when adding more resources. |
| event.updateTriggers(TriggerTracker.forEntity((Entity) holder)); | ||
| } | ||
|
|
||
| void onMaxCharged() { |
There was a problem hiding this comment.
Should this be called onMaxChanged :) ?
There was a problem hiding this comment.
I'm wondering, does anything need to be done to reduce the amount of mana if the max amount goes down?
There was a problem hiding this comment.
I was thinking about this, but with testing, reducing max works fine. The extra is just cut off, and it doesn't need to fill up (full for larger amount is also full for smaller amount)
There was a problem hiding this comment.
Regarding the name: No, dont think so, as this gets called when the resource is full, the check for max change is within this method.
(If max changes, but the resource is not fully charged, there was no problem.)
Perhaps this isnt needed, and the check could be instantly done. I dont know if comparing current charge vs max is faster than old max vs new max?
There was a problem hiding this comment.
I don't see any code calling this when the value is full - this is a new method only called when the attribute is changed, right?
Closes #509