diff --git a/pom.xml b/pom.xml
index 1d6152a..05ef5f8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -35,28 +35,13 @@
com.google.api-client
google-api-client
- 2.4.0
+ 2.4.1
- com.google.http-client
- google-http-client
- 1.44.1
-
-
- com.google.http-client
- google-http-client-jackson2
- 1.44.1
-
-
- com.google.oauth-client
- google-oauth-client
- 1.35.0
-
-
- com.google.apis
- google-api-services-youtube
- v3-rev222-1.25.0
-
+ com.google.apis
+ google-api-services-youtube
+ v3-rev222-1.25.0
+
diff --git a/src/main/java/MainClass.java b/src/main/java/MainClass.java
new file mode 100644
index 0000000..dba8f5d
--- /dev/null
+++ b/src/main/java/MainClass.java
@@ -0,0 +1,8 @@
+public class MainClass {
+ public static void main(String[] args) {
+ String apiKey = "AIzaSyA-wQ8i8vj_GKRuGJmtP-igFVNwaKrymIo"; // Replace with your actual YouTube API key
+ YouTubeBot bot = new YouTubeBot(apiKey);
+
+ // Your bot logic goes here
+ }
+}
diff --git a/src/main/java/MCchatbotyt.java b/src/main/java/YouTubeBot.java
similarity index 73%
rename from src/main/java/MCchatbotyt.java
rename to src/main/java/YouTubeBot.java
index c8b65ae..a9bc0ee 100644
--- a/src/main/java/MCchatbotyt.java
+++ b/src/main/java/YouTubeBot.java
@@ -1,50 +1,47 @@
-import org.bukkit.Bukkit;
-import org.bukkit.Server;
-
-import com.google.api.client.googleapis.javanet.GoogleNetHttpTransport;
-import com.google.api.client.json.JsonFactory;
-import com.google.api.client.json.jackson2.JacksonFactory;
-import com.google.api.services.youtube.YouTube;
-import com.google.api.services.youtube.model.VideoListResponse;
-import com.google.api.services.youtube.model.Video;
-
-public class YouTubeBot {
- private Server server;
- private YouTube youtube;
-
- public YouTubeBot(String apiKey) {
- try {
- this.server = Bukkit.getServer();
- this.youtube = new YouTube.Builder(
- GoogleNetHttpTransport.newTrustedTransport(),
- JacksonFactory.getDefaultInstance(),
- null)
- .setApplicationName("Crafty MC")
- .setYouTubeApiKey()
- .build();
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- public int getOnlinePlayersCount() {
- return server.getOnlinePlayers().size();
- }
-
- public void handleCommand(String command) {
- if (command.equalsIgnoreCase("!stats")) {
- String stats = getServerStatistics();
- // Send stats to YouTube chat or log for testing
- System.out.println(stats); // For testing, replace with actual sending to YouTube chat
- }
- }
-
- private String getServerStatistics() {
- // Use Spigot API or other methods to get server stats
- int onlinePlayers = server.getOnlinePlayers().size();
- // Construct and return server stats message
- return "Online Players: " + onlinePlayers;
- }
-
- // Other methods and bot logic
+import org.bukkit.Bukkit;
+import org.bukkit.Server;
+
+import com.google.api.client.googleapis.javanet.GoogleNetHttpTransport;
+import com.google.api.client.json.JsonFactory;
+import com.google.api.services.youtube.YouTube;
+
+public class YouTubeBot {
+ private Server server;
+ private YouTube youtube;
+
+ public YouTubeBot(String apiKey) {
+ try {
+ this.server = Bukkit.getServer();
+ this.youtube = new YouTube.Builder(
+ GoogleNetHttpTransport.newTrustedTransport())
+ .setApplicationName("Crafty MC")
+ .build();
+
+ // API Key
+ youtube.setApiKey(apiKey);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ public int getOnlinePlayersCount() {
+ return server.getOnlinePlayers().size();
+ }
+
+ public void handleCommand(String command) {
+ if (command.equalsIgnoreCase("!stats")) {
+ String stats = getServerStatistics();
+ // Send stats to YouTube chat or log for testing
+ System.out.println(stats); // For testing, replace with actual sending to YouTube chat
+ }
+ }
+
+ private String getServerStatistics() {
+ // Use Spigot API or other methods to get server stats
+ int onlinePlayers = server.getOnlinePlayers().size();
+ // Construct and return server stats message
+ return "Online Players: " + onlinePlayers;
+ }
+
+ // Other methods and bot logic
}
\ No newline at end of file
diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
index a84a05f..bac3e69 100644
--- a/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
+++ b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
@@ -1 +1,2 @@
-C:\Users\hbmann\Documents\Projects\_MCbotYT\MCyoutube_bot\src\main\java\MCchatbotyt.java
+C:\Users\hbmann\Documents\Projects\_MCbotYT\MCyoutube_bot\src\main\java\YouTubeBot.java
+C:\Users\hbmann\Documents\Projects\_MCbotYT\MCyoutube_bot\src\main\java\MainClass.java