mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-20 04:09:57 +00:00
Staff Charging Fix
This commit is contained in:
1 parent
fed82bc932
commit
38df157c40
2 files changed
+22
No files matched your search
@@ -88,6 +88,15 @@ public abstract class EntityEnergyAbility extends Entity implements IEntityAddit
|
||||
this.chargeDuration = duration;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset chargeTick back to chargeDuration so the charging timeout
|
||||
* grace period restarts. Used by items that let the player hold
|
||||
* a fully-charged orb indefinitely.
|
||||
*/
|
||||
public void resetChargeTick() {
|
||||
this.chargeTick = this.chargeDuration;
|
||||
}
|
||||
|
||||
public float getChargeProgress() {
|
||||
if (chargeDuration <= 0) return 1.0f;
|
||||
return Math.min(1.0f, (float) chargeTick / chargeDuration);
|
||||
|
||||
Reference in new issue
Block a user