mirror of
https://github.com/seppukudevelopment/seppuku
synced 2024-12-23 15:12:07 +00:00
Friends setting for greeter
This commit is contained in:
parent
e1146eec99
commit
e2a4a4f7eb
@ -13,6 +13,7 @@ import team.stiff.pomelo.impl.annotated.handler.annotation.Listener;
|
||||
*/
|
||||
public final class GreeterModule extends Module {
|
||||
|
||||
public final Value<Boolean> friends = new Value<Boolean>("Friends", new String[]{"Friend", "F"}, "Will only greet friends.", false);
|
||||
public final Value<Mode> mode = new Value<Mode>("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");
|
||||
|
Loading…
Reference in New Issue
Block a user