mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-23 02:55:45 +01:00
Fix sequential command execution with commands on both hands
This commit is contained in:
parent
0e1e3586af
commit
145f9e4f41
@ -204,6 +204,10 @@ public class CommandTrait extends Trait {
|
||||
for (NPCCommand command : commandList) {
|
||||
if (executionMode == ExecutionMode.SEQUENTIAL) {
|
||||
PlayerNPCCommand info = cooldowns.get(player.getUniqueId().toString());
|
||||
if (info != null && info.lastUsedHand != hand) {
|
||||
info.lastUsedHand = hand;
|
||||
info.lastUsedId = -1;
|
||||
}
|
||||
if (info != null && command.id <= info.lastUsedId) {
|
||||
if (info.lastUsedId == max) {
|
||||
info.lastUsedId = -1;
|
||||
@ -542,6 +546,8 @@ public class CommandTrait extends Trait {
|
||||
@Persist(valueType = Long.class)
|
||||
Map<String, Long> lastUsed = Maps.newHashMap();
|
||||
@Persist
|
||||
Hand lastUsedHand;
|
||||
@Persist
|
||||
int lastUsedId = -1;
|
||||
@Persist
|
||||
Map<String, Integer> nUsed = Maps.newHashMap();
|
||||
|
Loading…
Reference in New Issue
Block a user