Skip to content

Commit

Permalink
1.1.0
Browse files Browse the repository at this point in the history
NEW: Motd changer
  • Loading branch information
Alemiz committed Jul 10, 2019
1 parent 7f26adc commit 825dc72
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 2 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
✔️ StaffFind/StaffList<br>
✔️ PlayerFind<br>
✔️ QueryUpdater<br>
✔️ MOTD Changer<br>
<br>
## 📝 TODO:
✔️ API for PocketMine developers<br>
Expand Down Expand Up @@ -36,6 +37,16 @@ StaffChatCaller: "!"
#StaffChat format
#You can use: %player%, %message%,
StaffChatFormat: "§7[§6Staff§7] §f%player% : §7%message%"
#MOTD Changer Settings
#You can set here unlimited amount of MOTDSs
#Whithelist MOTD - coming soon
WMOTD:
- "§6Server §7» §l§cWartung"
- "§6Server §7» §l§cOffline"
#Normal non-whitelist MOTD
MOTD:
- "Test"
- "Test1"
...
```
## 📋 Special Thanks To:
Expand Down
6 changes: 6 additions & 0 deletions src/alemiz/stargate/StarGate.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import java.io.*;
import java.util.Arrays;
import java.util.List;
import java.util.Random;

import com.google.common.io.ByteStreams;
import net.md_5.bungee.event.EventHandler;
Expand Down Expand Up @@ -96,6 +97,11 @@ public void onProxyPing(ProxyPingEvent event){
ServerPing.Protocol prot = new ServerPing.Protocol("", ping.getVersion().getProtocol()); //NAME => MCPE Version
ping.setVersion(prot);

/* MOTD Changer*/
List<String> list = cfg.getStringList("MOTD");
String modt = list.get(new Random().nextInt(list.size()));
ping.setDescription(modt);

event.setResponse(ping);
}

Expand Down
16 changes: 15 additions & 1 deletion src/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,18 @@
StaffChatCaller: "!"
#StaffChat format
#You can use: %player%, %message%, %server%
StaffChatFormat: "§7[§6Staff§7] §f%player% : §7%message%"
StaffChatFormat: "§7[§6Staff§7] §f%player% : §7%message%"

#MOTD Changer Settings
#You can set here unlimited amount of MOTDSs

#Whithelist MOTD - coming soon
WMOTD:
- "§6Server §7» §l§cWartung"
- "§6Server §7» §l§cOffline"
#Normal non-whitelist MOTD
MOTD:
- "Test"
- "Test1"
- "Test2"
- "Test3"
2 changes: 1 addition & 1 deletion src/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: "StarGate"
version: 1.0.0
version: 1.1.0
author: "Alemiz"
description: "StarGate is super Core plugin for WaterFall"
main: alemiz.stargate.StarGate

0 comments on commit 825dc72

Please sign in to comment.