mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-11-23 18:55:11 +01:00
Remove unauthenticated chat recipients
only authenticated players can see the chat
This commit is contained in:
parent
e15c5fcb9c
commit
0601ab0e40
@ -59,8 +59,8 @@ public class AuthMePlayerListener implements Listener {
|
|||||||
private void handleChat(AsyncPlayerChatEvent event) {
|
private void handleChat(AsyncPlayerChatEvent event) {
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
for (Player p : Utils.getOnlinePlayers()) {
|
for (Player p : Utils.getOnlinePlayers()) {
|
||||||
if (p != player && !PlayerCache.getInstance().isAuthenticated(p.getName())) {
|
if (!PlayerCache.getInstance().isAuthenticated(p.getName())) {
|
||||||
event.getRecipients().remove(p);
|
event.getRecipients().remove(p); // TODO: it should be configurable
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -139,7 +139,7 @@ public final class Utils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!Settings.isForcedRegistrationEnabled) {
|
if (!Settings.isForcedRegistrationEnabled) {
|
||||||
// TODO ljacqu 20151123: Use a setter to retrieve things from AuthMe
|
// TODO ljacqu 20151123: Use a getter to retrieve things from AuthMe
|
||||||
if (!plugin.database.isAuthAvailable(player.getName())) {
|
if (!plugin.database.isAuthAvailable(player.getName())) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -162,16 +162,16 @@ public final class Utils {
|
|||||||
* @param w String
|
* @param w String
|
||||||
* @param pl Player
|
* @param pl Player
|
||||||
*/
|
*/
|
||||||
public static void packCoords(double x, double y, double z, String w,
|
public static void packCoords(double x, double y, double z, String w, final Player pl) {
|
||||||
final Player pl) {
|
|
||||||
World theWorld;
|
World theWorld;
|
||||||
if (w.equals("unavailableworld")) {
|
if (w.equals("unavailableworld")) {
|
||||||
theWorld = pl.getWorld();
|
theWorld = pl.getWorld();
|
||||||
} else {
|
} else {
|
||||||
theWorld = Bukkit.getWorld(w);
|
theWorld = Bukkit.getWorld(w);
|
||||||
}
|
}
|
||||||
if (theWorld == null)
|
if (theWorld == null) {
|
||||||
theWorld = pl.getWorld();
|
theWorld = pl.getWorld();
|
||||||
|
}
|
||||||
final World world = theWorld;
|
final World world = theWorld;
|
||||||
final Location loc = new Location(world, x, y, z);
|
final Location loc = new Location(world, x, y, z);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user