1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-10-04 18:11:43 +02:00

Prevent that hidden players broadcast afk messages

Prevent that moving players triggers unafk too early, they can now move within a radius of 3 blocks from the position where they went afk.
This commit is contained in:
snowleo
2011-09-02 16:15:57 +02:00
parent 61a377bc26
commit 8317797274
15 changed files with 62 additions and 28 deletions

View File

@@ -1,6 +1,7 @@
package com.earth2me.essentials.xmpp;
import com.earth2me.essentials.IEssentials;
import com.earth2me.essentials.IUser;
import com.earth2me.essentials.Util;
import java.util.List;
import java.util.logging.Level;
@@ -83,9 +84,10 @@ public class EssentialsXMPP extends JavaPlugin implements IEssentialsXMPP
}
@Override
public String getUserByAddress(final String address)
public IUser getUserByAddress(final String address)
{
return instance.users.getUserByAddress(address);
String username = instance.users.getUserByAddress(address);
return username == null ? null : ess.getUser(username);
}
@Override
@@ -122,9 +124,9 @@ public class EssentialsXMPP extends JavaPlugin implements IEssentialsXMPP
}
@Override
public void broadcastMessage(final String name, final String message)
public void broadcastMessage(final IUser sender, final String message)
{
ess.broadcastMessage(name, message);
ess.broadcastMessage(sender, message);
try
{
for (String address : getSpyUsers())