2024-11-16 12:37:12 +01:00
|
|
|
package eu.m724.tweaks;
|
|
|
|
|
|
|
|
import eu.m724.tweaks.chat.ChatCommands;
|
|
|
|
import eu.m724.tweaks.chat.ChatManager;
|
|
|
|
import eu.m724.tweaks.door.DoorListener;
|
2024-11-19 17:40:03 +01:00
|
|
|
import eu.m724.tweaks.motd.MotdListener;
|
2024-11-17 09:48:38 +01:00
|
|
|
import eu.m724.tweaks.ping.F3NameListener;
|
|
|
|
import eu.m724.tweaks.ping.PingChecker;
|
|
|
|
import eu.m724.tweaks.ping.PingCommands;
|
2024-11-19 17:40:03 +01:00
|
|
|
import eu.m724.tweaks.player.MusicPlayer;
|
2024-11-20 20:17:26 +01:00
|
|
|
import eu.m724.tweaks.worldborder.WorldBorderManager;
|
2024-11-16 12:37:12 +01:00
|
|
|
import org.bukkit.plugin.java.JavaPlugin;
|
|
|
|
|
2024-11-19 17:40:03 +01:00
|
|
|
import java.io.IOException;
|
2024-11-16 12:37:12 +01:00
|
|
|
import java.util.Objects;
|
|
|
|
|
|
|
|
public class TweaksPlugin extends JavaPlugin {
|
|
|
|
@Override
|
|
|
|
public void onEnable() {
|
|
|
|
ChatManager chatManager = new ChatManager(this);
|
|
|
|
chatManager.init();
|
|
|
|
|
|
|
|
ChatCommands chatCommands = new ChatCommands(chatManager);
|
|
|
|
Objects.requireNonNull(getCommand("chat")).setExecutor(chatCommands);
|
|
|
|
Objects.requireNonNull(getCommand("chatmanage")).setExecutor(chatCommands);
|
|
|
|
|
|
|
|
getServer().getPluginManager().registerEvents(new DoorListener(), this);
|
2024-11-17 09:48:38 +01:00
|
|
|
|
|
|
|
new F3NameListener(this).init();
|
|
|
|
new PingChecker(this).init();
|
|
|
|
Objects.requireNonNull(getCommand("ping")).setExecutor(new PingCommands());
|
2024-11-18 16:52:57 +01:00
|
|
|
Objects.requireNonNull(getCommand("dkick")).setExecutor(new PingCommands());
|
2024-11-19 17:40:03 +01:00
|
|
|
|
|
|
|
if (getServer().getPluginManager().getPlugin("voicechat") != null) {
|
|
|
|
new MusicPlayer(this).init();
|
|
|
|
} else {
|
|
|
|
getLogger().warning("To use voice extensions, install \"Simple Voice Chat\"");
|
|
|
|
}
|
|
|
|
|
|
|
|
try {
|
|
|
|
new MotdListener("example").init(this);
|
|
|
|
} catch (IOException e) {
|
|
|
|
getLogger().severe("Failed to initialize MOTD extension");
|
|
|
|
throw new RuntimeException(e);
|
|
|
|
}
|
2024-11-20 20:17:26 +01:00
|
|
|
|
|
|
|
new WorldBorderManager().init(this);
|
2024-11-16 12:37:12 +01:00
|
|
|
}
|
|
|
|
}
|