mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-09-27 14:53:09 +02:00
Fix hand tracking
This commit is contained in:
parent
af728ec4b1
commit
dbd9cdf1f1
@ -286,24 +286,25 @@ public class CommandTrait extends Trait {
|
|||||||
executionErrors.put(player.getUniqueId().toString(), EnumSet.noneOf(CommandTraitError.class));
|
executionErrors.put(player.getUniqueId().toString(), EnumSet.noneOf(CommandTraitError.class));
|
||||||
}
|
}
|
||||||
for (NPCCommand command : commandList) {
|
for (NPCCommand command : commandList) {
|
||||||
if (executionMode == ExecutionMode.SEQUENTIAL) {
|
PlayerNPCCommand info = null;
|
||||||
PlayerNPCCommand info = playerTracking.get(player.getUniqueId());
|
if (executionMode == ExecutionMode.SEQUENTIAL
|
||||||
if (info != null && info.lastUsedHand != hand) {
|
&& (info = playerTracking.get(player.getUniqueId())) != null) {
|
||||||
|
if (info.lastUsedHand != hand) {
|
||||||
info.lastUsedHand = hand;
|
info.lastUsedHand = hand;
|
||||||
info.lastUsedId = -1;
|
info.lastUsedId = -1;
|
||||||
}
|
}
|
||||||
if (info != null && command.id <= info.lastUsedId) {
|
if (command.id <= info.lastUsedId) {
|
||||||
if (info.lastUsedId == max) {
|
if (info.lastUsedId != max)
|
||||||
info.lastUsedId = -1;
|
|
||||||
} else {
|
|
||||||
continue;
|
continue;
|
||||||
}
|
info.lastUsedId = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
runCommand(player, command);
|
runCommand(player, command);
|
||||||
if (executionMode == ExecutionMode.SEQUENTIAL || charged != null && !charged) {
|
if (executionMode == ExecutionMode.SEQUENTIAL) {
|
||||||
break;
|
playerTracking.get(player.getUniqueId()).lastUsedHand = hand;
|
||||||
}
|
}
|
||||||
|
if (executionMode == ExecutionMode.SEQUENTIAL || (charged != null && !charged))
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user