new senderId sources and minor message mixin fix.

This commit is contained in:
Olof Larsson 2013-03-02 15:56:11 +01:00
parent 8e071f2f6f
commit 65f84c25fe
3 changed files with 61 additions and 4 deletions

View File

@ -49,10 +49,7 @@ public class MessageMixinDefault extends MessageMixinAbstract
{ {
if (sendee == null) return false; if (sendee == null) return false;
if (messages == null) return false; if (messages == null) return false;
for (String message : messages) sendee.sendMessage(messages.toArray(new String[0]));
{
sendee.sendMessage(message);
}
return true; return true;
} }

View File

@ -0,0 +1,30 @@
package com.massivecraft.mcore.store;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import com.massivecraft.mcore.mixin.Mixin;
public class SenderIdSourceMixinOnlinePlayerIds implements SenderIdSource
{
// -------------------------------------------- //
// INSTANCE & CONSTRUCT
// -------------------------------------------- //
private static SenderIdSourceMixinOnlinePlayerIds i = new SenderIdSourceMixinOnlinePlayerIds();
public static SenderIdSourceMixinOnlinePlayerIds get() { return i; }
// -------------------------------------------- //
// OVERRIDE
// -------------------------------------------- //
@Override
public Collection<Collection<String>> getSenderIdCollections()
{
List<Collection<String>> ret = new ArrayList<Collection<String>>();
ret.add(Mixin.getOnlinePlayerIds());
return ret;
}
}

View File

@ -0,0 +1,30 @@
package com.massivecraft.mcore.store;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import com.massivecraft.mcore.mixin.Mixin;
public class SenderIdSourceMixinOnlineSenderIds implements SenderIdSource
{
// -------------------------------------------- //
// INSTANCE & CONSTRUCT
// -------------------------------------------- //
private static SenderIdSourceMixinOnlineSenderIds i = new SenderIdSourceMixinOnlineSenderIds();
public static SenderIdSourceMixinOnlineSenderIds get() { return i; }
// -------------------------------------------- //
// OVERRIDE
// -------------------------------------------- //
@Override
public Collection<Collection<String>> getSenderIdCollections()
{
List<Collection<String>> ret = new ArrayList<Collection<String>>();
ret.add(Mixin.getOnlineSenderIds());
return ret;
}
}