diff --git a/nukkit/README.md b/nukkit/README.md index 9608f64..cd67714 100644 --- a/nukkit/README.md +++ b/nukkit/README.md @@ -7,11 +7,9 @@ Simply change the texts or messages which is sent by the server or other plugins Put it into your plugins folder. # Configuration -Edit ./plugins/TextReplacer/config.yml. +Check ./plugins/TextReplacer/config.yml. # Available Variables Player Name: {PLAYER} -Time: {YEAR}, {MONTH}, {DAY}, {HOUR}, {MINUTE}, {SECOND} - Level Name: {LEVEL} diff --git a/nukkit/resources/config.yml b/nukkit/resources/config.yml index 071703d..389a72c 100644 --- a/nukkit/resources/config.yml +++ b/nukkit/resources/config.yml @@ -1,10 +1,7 @@ # TextReplacer for Nukkit # Simply change the texts or messages which is sent by the server or other plugins. -# Available variables: {PLAYER}, {MONTH}, {DAY}, {HOUR}, {MINUTE}, {SECOND} +# Available variables: {PLAYER}, {LEVEL} # Format: "Text to be replaced": "Text you want" # Message on player joined. -"{PLAYER} joined the game.": "Welcome {PLAYER} to the server!" - -# Message on time displaying. -"Current Time: {MONTH}/{DAY} {HOUR}:{MINUTE}:{SECOND}": "Today: {MONTH}/{DAY}\nTime: {HOUR}:{MINUTE}:{SECOND}" \ No newline at end of file +"{PLAYER} joined the game.": "Welcome {PLAYER} to the server!" \ No newline at end of file diff --git a/nukkit/src/taylcd/TextReplacer.java b/nukkit/src/taylcd/TextReplacer.java index 115d793..527729c 100644 --- a/nukkit/src/taylcd/TextReplacer.java +++ b/nukkit/src/taylcd/TextReplacer.java @@ -1,9 +1,5 @@ package taylcd; -/* - * Make the world a better place. - */ - import cn.nukkit.event.EventHandler; import cn.nukkit.event.EventPriority; import cn.nukkit.event.Listener; @@ -49,13 +45,7 @@ public void onDataPacketSend(DataPacketSendEvent event) { HashMap variables = new HashMap() { { put("{PLAYER}", name); - put("{YEAR}", String.valueOf(time.get(Calendar.YEAR))); - put("{MONTH}", String.valueOf(time.get(Calendar.MONTH) + 1)); - put("{DAY}", String.valueOf(time.get(Calendar.DAY_OF_MONTH))); - put("{HOUR}", String.valueOf(time.get(Calendar.HOUR_OF_DAY))); - put("{MINUTE}", String.valueOf(time.get(Calendar.MINUTE))); - put("{SECOND}", String.valueOf(time.get(Calendar.SECOND))); - put("{LEVEL}", event.getPlayer().getLevel().getName()); + put("{LEVEL}", event.getPlayer().getLevel().getName()); } };