Merge pull request #61 from TheBritishMidget/master
Friends setting for greeter
This commit is contained in:
commit
9c4bf42180
|
@ -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