Updated NPCBase to with NPC#getState(NPCState)
Implemented net.jitse.npclib.api.NPC#getState(NPCState) to return a boolean indicating whether a state is toggled or not.
This commit is contained in:
parent
73df32172e
commit
47d3417606
|
@ -220,6 +220,18 @@ public abstract class NPCBase implements NPC, NPCPacketHandler {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getState(NPCState state) {
|
||||
if (activeStates.length != 0) {
|
||||
for (int i = 0; i < activeStates.length; i++) {
|
||||
if (activeStates[i] == state) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NPC toggleState(NPCState state) {
|
||||
int inActiveStatesIndex = -1;
|
||||
|
|
Loading…
Reference in New Issue