Fixes for /npc command sequential

This commit is contained in:
fullwall 2020-06-11 16:23:48 +08:00
parent 1fd6ccbad9
commit 244496dca3

View File

@ -125,13 +125,14 @@ public class CommandTrait extends Trait {
for (NPCCommand command : commandList) { for (NPCCommand command : commandList) {
if (sequential) { if (sequential) {
PlayerNPCCommand info = cooldowns.get(player.getUniqueId().toString()); PlayerNPCCommand info = cooldowns.get(player.getUniqueId().toString());
if (info != null && command.id < info.lastUsedId) { if (info != null && command.id <= info.lastUsedId) {
if (info.lastUsedId == max) { if (info.lastUsedId == max) {
info.lastUsedId = -1; info.lastUsedId = -1;
} } else {
continue; continue;
} }
} }
}
Runnable runnable = new Runnable() { Runnable runnable = new Runnable() {
@Override @Override
public void run() { public void run() {