mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-25 15:44:30 +00:00
Fix DBC Toggle Abilities and Wheel System
This commit is contained in:
1 parent
40a02b73e2
commit
0e6ece56c6
11 files changed
+453
-59
No files matched your search
@@ -3,14 +3,19 @@ package kamkeel.npcs.controllers.data.ability;
|
||||
/**
|
||||
* Tracks the state of a single active toggle for an entity.
|
||||
* Stored in AbstractDataAbilities.activeToggles map.
|
||||
* <p>
|
||||
* State is 1-based: state 1 = first ON state, state 2 = second, etc.
|
||||
* State 0 means OFF (entry should not exist in the map).
|
||||
*/
|
||||
public class ToggleEntry {
|
||||
private final Ability ability;
|
||||
private int tickCount;
|
||||
private int state;
|
||||
|
||||
public ToggleEntry(Ability ability) {
|
||||
public ToggleEntry(Ability ability, int state) {
|
||||
this.ability = ability;
|
||||
this.tickCount = 0;
|
||||
this.state = Math.max(1, state);
|
||||
}
|
||||
|
||||
public Ability getAbility() {
|
||||
@@ -24,4 +29,12 @@ public class ToggleEntry {
|
||||
public void incrementTick() {
|
||||
tickCount++;
|
||||
}
|
||||
|
||||
public int getState() {
|
||||
return state;
|
||||
}
|
||||
|
||||
public void setState(int state) {
|
||||
this.state = Math.max(1, state);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user