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:
@@ -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
|
@Override
|
||||||
public NPC toggleState(NPCState state) {
|
public NPC toggleState(NPCState state) {
|
||||||
int inActiveStatesIndex = -1;
|
int inActiveStatesIndex = -1;
|
||||||
|
|||||||
Reference in New Issue
Block a user