From 26f3485550f9b73c2ea1c8c69d91cc6dc14c4157 Mon Sep 17 00:00:00 2001 From: Olof Larsson Date: Mon, 10 Aug 2015 11:17:31 +0200 Subject: [PATCH] Only check sender presence and type when required. --- .../massivecore/cmd/arg/ARSenderIdAbstract.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/com/massivecraft/massivecore/cmd/arg/ARSenderIdAbstract.java b/src/com/massivecraft/massivecore/cmd/arg/ARSenderIdAbstract.java index ed70c4f3..bdce9293 100644 --- a/src/com/massivecraft/massivecore/cmd/arg/ARSenderIdAbstract.java +++ b/src/com/massivecraft/massivecore/cmd/arg/ARSenderIdAbstract.java @@ -146,7 +146,12 @@ public abstract class ARSenderIdAbstract extends ARAbstract if ( ! coll.contains(senderId)) continue; // ... and the presence check passes ... - if ( ! IdUtil.getMaintainedIds().contains(senderId, presence, type)) continue; + // NOTE: Certain SenderColls will on purpose contain other things than players. + // NOTE: For that reason we only check sender presence and type if a certain one is required. + if (this.presence != SenderPresence.ANY || this.type != SenderType.ANY) + { + if ( ! IdUtil.getMaintainedIds().contains(senderId, this.presence, this.type)) continue; + } // ... and the result is non null ... T result = this.getResultForSenderId(senderId);