From e2a4a4f7ebc03b0e4b6eec8d916c28d1677be401 Mon Sep 17 00:00:00 2001 From: TheBritishMidget Date: Thu, 15 Apr 2021 13:27:41 +0100 Subject: [PATCH] Friends setting for greeter --- .../me/rigamortis/seppuku/impl/module/misc/GreeterModule.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/me/rigamortis/seppuku/impl/module/misc/GreeterModule.java b/src/main/java/me/rigamortis/seppuku/impl/module/misc/GreeterModule.java index dfdf3e6..a710b19 100644 --- a/src/main/java/me/rigamortis/seppuku/impl/module/misc/GreeterModule.java +++ b/src/main/java/me/rigamortis/seppuku/impl/module/misc/GreeterModule.java @@ -13,6 +13,7 @@ import team.stiff.pomelo.impl.annotated.handler.annotation.Listener; */ public final class GreeterModule extends Module { + public final Value friends = new Value("Friends", new String[]{"Friend", "F"}, "Will only greet friends.", false); public final Value mode = new Value("Mode", new String[]{"Mode", "M"}, "Change between greeter modes. Client mode will only appear for you, Server mode will broadcast the greeting message for everyone.", Mode.CLIENT); private enum Mode { @@ -30,6 +31,7 @@ public final class GreeterModule extends Module { @Listener public void onPlayerJoin(EventPlayerJoin event) { + if (friends.getValue() && Seppuku.INSTANCE.getFriendManager().find(event.getName()) == null) return; switch (this.mode.getValue()) { case CLIENT: Seppuku.INSTANCE.logChat(event.getName() + " has joined the game"); @@ -42,6 +44,7 @@ public final class GreeterModule extends Module { @Listener public void onPlayerLeave(EventPlayerLeave event) { + if (friends.getValue() && Seppuku.INSTANCE.getFriendManager().find(event.getName()) == null) return; switch (this.mode.getValue()) { case CLIENT: Seppuku.INSTANCE.logChat(event.getName() + " has left the game");