Skip to content
This repository was archived by the owner on Nov 20, 2024. It is now read-only.

Commit 64a4641

Browse files
authored
Added Files
FlameMOTD v1.0.1
1 parent 10ffdff commit 64a4641

File tree

8 files changed

+158
-20
lines changed

8 files changed

+158
-20
lines changed

README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
# FlameMOTD | 1.7.x-1.21.x
1+
# FlameMOTD | 1.0.1
22
* By FlameClubDevelopment
33

44
# Features
55
* The original MOTDCountdown plugin with customizable time text
6-
* Original Plugin: https://www.spigotmc.org/resources/motdcountdown.23249/
7-
8-
![image](https://github.com/FlameClubDevelopment/FlameMOTD/assets/171498681/f8a36a46-f6b1-4fea-85c3-dc028fcd2e40)

pom.xml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<groupId>club.flame.flamemotd</groupId>
8+
<artifactId>FlameMOTD</artifactId>
9+
<version>1.0.1</version>
10+
11+
<properties>
12+
<java.version>1.8</java.version>
13+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
14+
</properties>
15+
16+
<repositories>
17+
<repository>
18+
<id>sonatype</id>
19+
<url>https://oss.sonatype.org/content/groups/public/</url>
20+
</repository>
21+
</repositories>
22+
23+
<dependencies>
24+
<dependency>
25+
<groupId>net.md-5</groupId>
26+
<artifactId>bungeecord-api</artifactId>
27+
<version>1.12-SNAPSHOT</version>
28+
<scope>system</scope>
29+
<systemPath>${project.basedir}/libs/Bungee.jar</systemPath>
30+
</dependency>
31+
<dependency>
32+
<groupId>org.projectlombok</groupId>
33+
<artifactId>lombok</artifactId>
34+
<version>1.18.24</version>
35+
<scope>provided</scope>
36+
</dependency>
37+
<dependency>
38+
<groupId>org.bukkit</groupId>
39+
<artifactId>bukkit</artifactId>
40+
<version>1.13.1-R0.1-SNAPSHOT</version>
41+
<scope>provided</scope>
42+
</dependency>
43+
</dependencies>
44+
45+
<build>
46+
<sourceDirectory>src/main/java</sourceDirectory>
47+
<plugins>
48+
<plugin>
49+
<groupId>org.apache.maven.plugins</groupId>
50+
<artifactId>maven-compiler-plugin</artifactId>
51+
<version>3.8.1</version>
52+
<executions>
53+
<execution>
54+
<id>default-compile</id>
55+
<phase>none</phase>
56+
</execution>
57+
<execution>
58+
<id>java-compile</id>
59+
<phase>compile</phase>
60+
<goals> <goal>compile</goal> </goals>
61+
</execution>
62+
<execution>
63+
<id>testCompile</id>
64+
<phase>test-compile</phase>
65+
<goals>
66+
<goal>testCompile</goal>
67+
</goals>
68+
</execution>
69+
</executions>
70+
<configuration>
71+
<source>1.8</source>
72+
<target>1.8</target>
73+
<annotationProcessorPaths>
74+
<path>
75+
<groupId>org.projectlombok</groupId>
76+
<artifactId>lombok</artifactId>
77+
<version>1.16.16</version>
78+
</path>
79+
</annotationProcessorPaths>
80+
</configuration>
81+
</plugin>
82+
</plugins>
83+
</build>
84+
</project>

src/main/java/club/flame/flamemotd/FlameMOTD.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
import java.util.Date;
66
import java.util.TimeZone;
77
import java.util.concurrent.TimeUnit;
8+
9+
import club.flame.flamemotd.utils.CC;
10+
import com.sun.org.apache.bcel.internal.classfile.Signature;
11+
import net.md_5.bungee.BungeeCord;
812
import net.md_5.bungee.api.ChatColor;
913
import org.bukkit.Bukkit;
1014
import org.bukkit.command.Command;

src/main/java/club/flame/flamemotd/bungee/FlameMOTDCommand.java

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package club.flame.flamemotd.bungee;
22

3+
import club.flame.flamemotd.utils.CC;
34
import net.md_5.bungee.api.ChatColor;
45
import net.md_5.bungee.api.CommandSender;
56
import net.md_5.bungee.api.plugin.Command;
@@ -8,7 +9,7 @@ public class FlameMOTDCommand extends Command {
89
private Main plugin;
910

1011
public FlameMOTDCommand(Main plugin) {
11-
super("flamemotd");
12+
super("flamemotd", "", "motd");
1213
this.plugin = plugin;
1314
}
1415

@@ -20,21 +21,21 @@ public void execute(CommandSender sender, String[] args) {
2021
sender.sendMessage(t("&c&lFlameMOTD&7 &areloaded successfully!"));
2122
sender.sendMessage(t("&7Reloaded files: &fconfig.yml"));
2223
} else {
23-
sender.sendMessage(t("&cNo permission."));
24+
sender.sendMessage(t("&cYou don't have permissions."));
2425
}
2526
} else {
26-
sender.sendMessage("§7§m-------------------------");
27-
sender.sendMessage("§c§lFlameMOTD§7 §8- §71.0-SNAPSHOT");
28-
sender.sendMessage("");
29-
sender.sendMessage(8- §7/flamemotd reload");
30-
sender.sendMessage("§7§m-------------------------");
27+
sender.sendMessage(CC.translate("&4&m=============================="));
28+
sender.sendMessage(CC.translate("&c&lFlameMOTD&7 &8- &71.0.1"));
29+
sender.sendMessage(CC.translate(""));
30+
sender.sendMessage(CC.translate("&8- &7/flamemotd reload"));
31+
sender.sendMessage(CC.translate("&4&m=============================="));
3132
}
3233
} else {
33-
sender.sendMessage("§7§m-------------------------");
34-
sender.sendMessage("§c§lFlameMOTD§7 §8- §71.0-SNAPSHOT");
35-
sender.sendMessage("");
36-
sender.sendMessage(8- §7/flamemotd reload");
37-
sender.sendMessage("§7§m-------------------------");
34+
sender.sendMessage(CC.translate("&4&m=============================="));
35+
sender.sendMessage(CC.translate("&c&lFlameMOTD&7 &8- &71.0.1"));
36+
sender.sendMessage(CC.translate(""));
37+
sender.sendMessage(CC.translate("&8- &7/flamemotd reload"));
38+
sender.sendMessage(CC.translate("&4&m=============================="));
3839
}
3940

4041
}

src/main/java/club/flame/flamemotd/bungee/Main.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
import java.util.Date;
1111
import java.util.TimeZone;
1212
import java.util.concurrent.TimeUnit;
13+
14+
import club.flame.flamemotd.utils.CC;
15+
import net.md_5.bungee.BungeeCord;
1316
import net.md_5.bungee.api.ChatColor;
1417
import net.md_5.bungee.api.ServerPing;
1518
import net.md_5.bungee.api.event.ProxyPingEvent;
@@ -28,6 +31,15 @@ public class Main extends Plugin implements Listener {
2831
public void onEnable() {
2932
this.getProxy().getPluginManager().registerListener(this, this);
3033
this.getProxy().getPluginManager().registerCommand(this, new FlameMOTDCommand(this));
34+
BungeeCord.getInstance().getConsole().sendMessage(CC.translate("&4&m=============================="));
35+
BungeeCord.getInstance().getConsole().sendMessage(CC.translate("&cFlameMOTD &8- &fv" + getDescription().getVersion()));
36+
BungeeCord.getInstance().getConsole().sendMessage(CC.translate(""));
37+
BungeeCord.getInstance().getConsole().sendMessage(CC.translate("&4Author&f: " + getDescription().getAuthor()));
38+
BungeeCord.getInstance().getConsole().sendMessage(CC.translate("&4State&f: &aEnabled"));
39+
BungeeCord.getInstance().getConsole().sendMessage(CC.translate(""));
40+
BungeeCord.getInstance().getConsole().sendMessage(CC.translate("&7&oThank you for using FlameMOTD"));
41+
BungeeCord.getInstance().getConsole().sendMessage(CC.translate("&7&oJoin our Discord dsc.gg/flameclubdevelopment"));
42+
BungeeCord.getInstance().getConsole().sendMessage(CC.translate("&4&m=============================="));
3143
if (!this.getDataFolder().exists()) {
3244
this.getDataFolder().mkdir();
3345
File file = new File(this.getDataFolder(), "config.yml");
@@ -218,6 +230,18 @@ public int getCountdown() {
218230
}
219231
}
220232

233+
public void onDisable() {
234+
BungeeCord.getInstance().getConsole().sendMessage(CC.translate("&4&m=============================="));
235+
BungeeCord.getInstance().getConsole().sendMessage(CC.translate("&cFlameMOTD &8- &fv" + getDescription().getVersion()));
236+
BungeeCord.getInstance().getConsole().sendMessage(CC.translate(""));
237+
BungeeCord.getInstance().getConsole().sendMessage(CC.translate("&4Author&f: " + getDescription().getAuthor()));
238+
BungeeCord.getInstance().getConsole().sendMessage(CC.translate("&4State&f: &cDisabled"));
239+
BungeeCord.getInstance().getConsole().sendMessage(CC.translate(""));
240+
BungeeCord.getInstance().getConsole().sendMessage(CC.translate("&7&oThank you for using FlameMOTD"));
241+
BungeeCord.getInstance().getConsole().sendMessage(CC.translate("&7&oJoin our Discord dsc.gg/flameclubdevelopment"));
242+
BungeeCord.getInstance().getConsole().sendMessage(CC.translate("&4&m=============================="));
243+
}
244+
221245
public static String t(String i) {
222246
return ChatColor.translateAlternateColorCodes('&', i);
223247
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package club.flame.flamemotd.utils;
2+
3+
import net.md_5.bungee.api.*;
4+
import java.util.*;
5+
import java.util.stream.Collectors;
6+
import java.util.stream.Stream;
7+
8+
/**
9+
* Author: HCFAlerts
10+
* Project: BungeeUtils
11+
* SRC and Jar available at dsc.gg/liteclubdevelopment
12+
* or github.com/HCFAlerts --> github.com/liteclubdevelopment
13+
*/
14+
15+
public class CC {
16+
17+
public static String translate(String input) {
18+
return ChatColor.translateAlternateColorCodes('&', input);
19+
}
20+
21+
public static List<String> translate(List<String> input) {
22+
return input.stream().map(CC::translate).collect(Collectors.toList());
23+
}
24+
25+
public static List<String> translate(String[] lines) {
26+
return Stream.of(lines).map(CC::translate).collect(Collectors.toList());
27+
}
28+
}

src/main/resources/bungee.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
name: FlameMOTD
22
main: club.flame.flamemotd.bungee.Main
3-
version: 1.0-SNAPSHOT
4-
author: FlameClubDevelopment
3+
version: 1.0.1
4+
author: HCFAlerts

src/main/resources/plugin.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: FlameMOTD
2-
author: FlameClubDevelopment
3-
version: 1.0-SNAPSHOT
2+
author: HCFAlerts
3+
version: 1.0.1
44
main: club.flame.flamemotd.FlameMOTD
55
commands:
66
flamemotd:

0 commit comments

Comments
 (0)