aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/de/hype/bbsentials/api/Discord.java70
-rw-r--r--src/main/java/de/hype/bbsentials/api/ISimpleOption.java5
-rw-r--r--src/main/java/de/hype/bbsentials/api/Options.java13
-rw-r--r--src/main/java/de/hype/bbsentials/chat/Chat.java466
-rw-r--r--src/main/java/de/hype/bbsentials/chat/Message.java117
-rw-r--r--src/main/java/de/hype/bbsentials/chat/Sender.java106
-rw-r--r--src/main/java/de/hype/bbsentials/client/BBUtils.java66
-rw-r--r--src/main/java/de/hype/bbsentials/client/BBsentials.java261
-rw-r--r--src/main/java/de/hype/bbsentials/client/BBsentialsConfigScreemFactory.java304
-rw-r--r--src/main/java/de/hype/bbsentials/client/Commands/CommandsOLD.java365
-rw-r--r--src/main/java/de/hype/bbsentials/client/Config.java205
-rw-r--r--src/main/java/de/hype/bbsentials/client/CustomGson.java28
-rw-r--r--src/main/java/de/hype/bbsentials/client/DebugThread.java52
-rw-r--r--src/main/java/de/hype/bbsentials/client/ModMenueScreen.java18
-rw-r--r--src/main/java/de/hype/bbsentials/client/SplashManager.java58
-rw-r--r--src/main/java/de/hype/bbsentials/client/SplashStatusUpdateListener.java65
-rw-r--r--src/main/java/de/hype/bbsentials/client/ToDisplayConfig.java96
-rw-r--r--src/main/java/de/hype/bbsentials/communication/BBsentialConnection.java569
-rw-r--r--src/main/java/de/hype/bbsentials/constants/BBDisplayNameProvider.java23
-rw-r--r--src/main/java/de/hype/bbsentials/constants/BBDisplayNameProviderWithCustom.java6
-rw-r--r--src/main/java/de/hype/bbsentials/constants/enviromentShared/AuthenticationConstants.java7
-rw-r--r--src/main/java/de/hype/bbsentials/constants/enviromentShared/ChChestItem.java46
-rw-r--r--src/main/java/de/hype/bbsentials/constants/enviromentShared/ChChestItems.java87
-rw-r--r--src/main/java/de/hype/bbsentials/constants/enviromentShared/EnumUtils.java208
-rw-r--r--src/main/java/de/hype/bbsentials/constants/enviromentShared/InternalReasonConstants.java14
-rw-r--r--src/main/java/de/hype/bbsentials/constants/enviromentShared/Islands.java47
-rw-r--r--src/main/java/de/hype/bbsentials/constants/enviromentShared/MiningEvents.java39
-rw-r--r--src/main/java/de/hype/bbsentials/mixins/ClientCommandSourceMixin.java56
-rw-r--r--src/main/java/de/hype/bbsentials/mixins/ItemRendererMixin.java40
-rw-r--r--src/main/java/de/hype/bbsentials/mixins/ScreenMixin.java26
-rw-r--r--src/main/java/de/hype/bbsentials/mixins/SimpleOptionMixin.java33
-rw-r--r--src/main/java/de/hype/bbsentials/packets/AbstractPacket.java67
-rw-r--r--src/main/java/de/hype/bbsentials/packets/EnviromentPacketConfig.java7
-rw-r--r--src/main/java/de/hype/bbsentials/packets/Packet.java26
-rw-r--r--src/main/java/de/hype/bbsentials/packets/PacketManager.java53
-rw-r--r--src/main/java/de/hype/bbsentials/packets/PacketUtils.java103
-rw-r--r--src/main/java/de/hype/bbsentials/packets/packets/BingoChatMessagePacket.java25
-rw-r--r--src/main/java/de/hype/bbsentials/packets/packets/BroadcastMessagePacket.java18
-rw-r--r--src/main/java/de/hype/bbsentials/packets/packets/ChChestPacket.java23
-rw-r--r--src/main/java/de/hype/bbsentials/packets/packets/DisconnectPacket.java23
-rw-r--r--src/main/java/de/hype/bbsentials/packets/packets/DisplayTellrawMessagePacket.java12
-rw-r--r--src/main/java/de/hype/bbsentials/packets/packets/InternalCommandPacket.java32
-rw-r--r--src/main/java/de/hype/bbsentials/packets/packets/InvalidCommandFeedbackPacket.java24
-rw-r--r--src/main/java/de/hype/bbsentials/packets/packets/MiningEventPacket.java25
-rw-r--r--src/main/java/de/hype/bbsentials/packets/packets/PartyPacket.java16
-rw-r--r--src/main/java/de/hype/bbsentials/packets/packets/PunishUserPacket.java24
-rw-r--r--src/main/java/de/hype/bbsentials/packets/packets/RequestConnectPacket.java20
-rw-r--r--src/main/java/de/hype/bbsentials/packets/packets/SplashNotifyPacket.java28
-rw-r--r--src/main/java/de/hype/bbsentials/packets/packets/SplashUpdatePacket.java22
-rw-r--r--src/main/java/de/hype/bbsentials/packets/packets/SystemMessagePacket.java16
-rw-r--r--src/main/java/de/hype/bbsentials/packets/packets/WelcomeClientPacket.java18
51 files changed, 0 insertions, 4078 deletions
diff --git a/src/main/java/de/hype/bbsentials/api/Discord.java b/src/main/java/de/hype/bbsentials/api/Discord.java
deleted file mode 100644
index 3f47439..0000000
--- a/src/main/java/de/hype/bbsentials/api/Discord.java
+++ /dev/null
@@ -1,70 +0,0 @@
-package de.hype.bbsentials.api;
-
-import de.hype.bbsentials.chat.Chat;
-import de.hype.bbsentials.client.BBsentials;
-import org.apache.http.HttpEntity;
-import org.apache.http.client.methods.CloseableHttpResponse;
-import org.apache.http.client.methods.HttpPost;
-import org.apache.http.entity.StringEntity;
-import org.apache.http.impl.client.CloseableHttpClient;
-import org.apache.http.impl.client.HttpClients;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.nio.charset.StandardCharsets;
-
-public class Discord {
- public static void sendWebhookMessage(String message) {
- Thread thread = new Thread(new Runnable() {
- @Override
- public void run() {
- sendWebhookMessageNoThread(message);
- }
- });
- thread.start();
- }
-
-
- public static void sendWebhookMessageNoThread(String message) {
- CloseableHttpClient httpClient = HttpClients.createDefault();
- String WEBHOOK_URL = "https://discord.com/api/v8/webhooks/1127524566407860276/" + BBsentials.getConfig().getApiKey();
-
-
- try {
- HttpPost httpPost = new HttpPost(WEBHOOK_URL);
-
- StringEntity jsonEntity = new StringEntity("{\"content\": \"" + message + "\"}", StandardCharsets.UTF_8);
- jsonEntity.setContentType("application/json");
- httpPost.setEntity(jsonEntity);
-
- CloseableHttpResponse response = httpClient.execute(httpPost);
- HttpEntity responseEntity = response.getEntity();
-
- if (responseEntity != null) {
- InputStream inputStream = responseEntity.getContent();
- BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
-
- String line;
- StringBuilder responseBuilder = new StringBuilder();
- while ((line = reader.readLine()) != null) {
- responseBuilder.append(line);
- }
-
- String responseString = responseBuilder.toString();
- Chat.sendPrivateMessageToSelfInfo(responseString);
- }
-
- response.close();
- } catch (IOException e) {
- e.printStackTrace();
- } finally {
- try {
- httpClient.close();
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- }
-}
diff --git a/src/main/java/de/hype/bbsentials/api/ISimpleOption.java b/src/main/java/de/hype/bbsentials/api/ISimpleOption.java
deleted file mode 100644
index c6e1158..0000000
--- a/src/main/java/de/hype/bbsentials/api/ISimpleOption.java
+++ /dev/null
@@ -1,5 +0,0 @@
-package de.hype.bbsentials.api;
-
-public interface ISimpleOption {
- void set(Object value);
-}
diff --git a/src/main/java/de/hype/bbsentials/api/Options.java b/src/main/java/de/hype/bbsentials/api/Options.java
deleted file mode 100644
index 7dc4b0d..0000000
--- a/src/main/java/de/hype/bbsentials/api/Options.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package de.hype.bbsentials.api;
-
-import net.minecraft.client.MinecraftClient;
-
-public class Options{
- public static void setFov(int value) {
- ((ISimpleOption) (Object) MinecraftClient.getInstance().options.getFov()).set(value);
- }
- public static void setGamma(double value) {
- ((ISimpleOption) (Object) MinecraftClient.getInstance().options.getGamma()).set(value);
- }
-}
-
diff --git a/src/main/java/de/hype/bbsentials/chat/Chat.java b/src/main/java/de/hype/bbsentials/chat/Chat.java
deleted file mode 100644
index ac5f892..0000000
--- a/src/main/java/de/hype/bbsentials/chat/Chat.java
+++ /dev/null
@@ -1,466 +0,0 @@
-package de.hype.bbsentials.chat;
-
-import de.hype.bbsentials.client.BBsentials;
-import de.hype.bbsentials.client.Config;
-import de.hype.bbsentials.packets.packets.SplashUpdatePacket;
-import net.fabricmc.fabric.api.client.message.v1.ClientReceiveMessageEvents;
-import net.fabricmc.fabric.api.client.message.v1.ClientSendMessageEvents;
-import net.minecraft.client.MinecraftClient;
-import net.minecraft.text.Text;
-import net.minecraft.util.Formatting;
-
-import javax.sound.sampled.AudioInputStream;
-import javax.sound.sampled.AudioSystem;
-import javax.sound.sampled.Clip;
-import java.io.IOException;
-import java.io.InputStream;
-import java.lang.reflect.Field;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Modifier;
-import java.time.Instant;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import static de.hype.bbsentials.client.BBsentials.*;
-
-public class Chat {
- public Chat() {
- init();
- }
-
- public static String[] getVariableInfo(String packageName, String className) {
- List<String> variableInfoList = new ArrayList<>();
-
- // Combine the class name with the package name
- String fullClassName = packageName + "." + className;
-
- // Load the class
- Class<?> clazz = null;
- try {
- clazz = Class.forName(fullClassName);
- } catch (ClassNotFoundException e) {
- e.printStackTrace();
- }
-
- // Extract fields of the class
- Field[] fields = clazz.getDeclaredFields();
-
- // Collect information for each field
- for (Field field : fields) {
- // Exclude transient fields
- if (java.lang.reflect.Modifier.isTransient(field.getModifiers())) {
- continue;
- }
- String variableName = field.getName();
- String variablePackageName = clazz.getPackage().getName();
- String variableClassName = clazz.getSimpleName();
-
- variableInfoList.add(variableName);
- }
-
- return variableInfoList.toArray(new String[variableInfoList.size()]);
- }
-
- public static void setVariableValue(Object obj, String variableName, String value) throws ClassNotFoundException, NoSuchFieldException, IllegalAccessException, InstantiationException, InvocationTargetException, NoSuchMethodException {
- if (value == null) {
- // Handle null value case
- sendPrivateMessageToSelfError("Invalid value: null");
- return;
- }
-
- Class<?> objClass = obj.getClass();
- Field field = objClass.getDeclaredField(variableName);
- field.setAccessible(true);
-
- // Get the type of the field
- Class<?> fieldType = field.getType();
-
- // Convert the value to the appropriate type
- Object convertedValue = parseValue(value, fieldType);
-
- if (Modifier.isStatic(field.getModifiers())) {
- // If the field is static
- field.set(null, convertedValue);
- }
- else {
- field.set(obj, convertedValue);
- }
-
- // Check and output the value of the variable
- sendPrivateMessageToSelfSuccess("The variable " + field.getName() + " is now: " + field.get(obj));
- }
-
- private static Object parseValue(String value, Class<?> targetType) {
- if (targetType == int.class || targetType == Integer.class) {
- return Integer.parseInt(value);
- }
- else if (targetType == double.class || targetType == Double.class) {
- return Double.parseDouble(value);
- }
- else if (targetType == float.class || targetType == Float.class) {
- return Float.parseFloat(value);
- }
- else if (targetType == long.class || targetType == Long.class) {
- return Long.parseLong(value);
- }
- else if (targetType == boolean.class || targetType == Boolean.class) {
- return Boolean.parseBoolean(value);
- }
- else {
- // For other types, return the original string value
- return value;
- }
- }
-
- public static void getVariableValue(Object object, String variableName) throws NoSuchFieldException, IllegalAccessException {
- Class<?> objClass = object.getClass();
- Field field = objClass.getDeclaredField(variableName);
- field.setAccessible(true);
- sendPrivateMessageToSelfSuccess("The variable " + field.getName() + " is: " + field.get(object));
- }
-
- private void init() {
- // Register a callback for a custom message type
- ClientReceiveMessageEvents.CHAT.register((message, signedMessage, sender, params, receptionTimestamp) -> {
- onEvent(message);
- });
- ClientReceiveMessageEvents.MODIFY_GAME.register((message, overlay) -> (onEvent(message)));
- ClientSendMessageEvents.CHAT.register(message -> {
- if (message.startsWith("/")) {
- System.out.println("Sent command: " + message);
- }
- });
- }
-
- private Text onEvent(Text text) {
- if (!isSpam(text.toString())) {
- if (getConfig().isDetailedDevModeEnabled()) {
- System.out.println("got a message: " + Text.Serializer.toJson(text));
- }
- Message message = new Message(text);
- executionService.execute(() -> processThreaded(message));
- return processNotThreaded(message);
- }
- return text; // Return the original message if it is spam
- }
-
- //Handle in the messages which need to be modified here
- public Text processNotThreaded(Message message) {
-// if (message.isFromParty()) {
-// message.replaceInJson("\"action\":\"run_command\",\"value\":\"/viewprofile", "\"action\":\"run_command\",\"value\":\"/bviewprofile " + messageUnformatted.split(">", 1)[1].trim());
-// }
- if (message.isFromReportedUser()) {
- sendPrivateMessageToSelfBase(Formatting.RED + "B: " + message.getUnformattedString());
- return null;
- }
- if (config.doPartyChatCustomMenu && message.isFromParty()) {
- message.replaceInJson("/viewprofile \\w{8}-\\w{4}-\\w{4}-\\w{4}-\\w{12}", "/socialoptions party " + message.getPlayerName() + " " + message.getUnformattedString());
- }
- else if (config.doGuildChatCustomMenu && message.isFromGuild()) {
- message.replaceInJson("/viewprofile \\w{8}-\\w{4}-\\w{4}-\\w{4}-\\w{12}", "/socialoptions guild " + message.getPlayerName() + " " + message.getUnformattedString());
- }
- else if (config.doAllChatCustomMenu) {
- System.out.println("User: '" + message.getPlayerName() + "' | Message: " + message.getUnformattedString());
- message.replaceInJson("/socialoptions " + message.getPlayerName(), "/socialoptions sb " + message.getPlayerName() + " " + message.getUnformattedString());
- }
-
- return message.text;
- }
-
- public void processThreaded(Message message) {
- if (message.getString() != null) {
- String messageUnformatted = message.getUnformattedString();
- String username = message.getPlayerName();
- if (message.isFromReportedUser()) {
-
- }
- else if (!MinecraftClient.getInstance().isWindowFocused()) {
- if (config.doDesktopNotifications) {
- if ((messageUnformatted.endsWith("is visiting Your Garden !") || messageUnformatted.endsWith("is visiting Your Island !")) && !MinecraftClient.getInstance().isWindowFocused() && config.doDesktopNotifications) {
- sendNotification("BBsentials Visit-Watcher", messageUnformatted);
- }
- else if (message.isMsg()) {
- sendNotification("BBsentials Message Notifier", username + " sent you the following message: " + message.getMessageContent());
- }
- if (message.getMessageContent().toLowerCase().contains(getConfig().getUsername().toLowerCase()) || (message.getMessageContent().toLowerCase().contains(getConfig().getNickname().toLowerCase() + " ") && getConfig().getNotifForParty().toLowerCase().equals("nick")) || getConfig().getNotifForParty().toLowerCase().equals("all")) {
- sendNotification("BBsentials Party Chat Notification", username + " : " + message.getMessageContent());
- }
- else {
- if (message.getMessageContent().toLowerCase().contains(getConfig().getUsername().toLowerCase()) || message.getMessageContent().toLowerCase().contains(config.getNickname().toLowerCase() + " ")) {
- sendNotification("BBsentials Notifier", "You got mentioned in chat! " + message.getMessageContent());
- }
- }
- }
- }
- else if (message.isServerMessage()) {
- if (messageUnformatted.contains("disbanded the party")) {
- lastPartyDisbandedUsername = username;
- partyDisbandedMap.put(username, Instant.now());
- }
- else if (message.contains("invited you to join their party")) {
- if (lastPartyDisbandedUsername != null && partyDisbandedMap != null) {
- Instant lastDisbandedInstant = partyDisbandedMap.get(lastPartyDisbandedUsername);
- if (config.acceptReparty) {
- if (lastDisbandedInstant != null && lastDisbandedInstant.isAfter(Instant.now().minusSeconds(20)) && (username.equals(lastPartyDisbandedUsername))) {
- sendCommand("/p accept " + username);
- }
- }
- }
- if (!MinecraftClient.getInstance().isWindowFocused()) {
- sendNotification("BBsentials Party Notifier", "You got invited too a party by: " + username);
- }
- }
- else if (message.startsWith("Party Members (")) {
- Config.partyMembers = new ArrayList<>();
- }
- else if (message.startsWith("Party Moderators:")) {
- String temp = messageUnformatted.replace("Party Moderators:", "").replace(" ●", "").replaceAll("\\s*\\[[^\\]]+\\]", "").trim();
- if (temp.contains(",")) {
- for (int i = 0; i < temp.split(",").length; i++) {
- Config.partyMembers.add(temp.split(",")[i - 1]);
- }
- }
- else {
- Config.partyMembers.add(temp);
- }
- }
- else if (message.startsWith("Party Members:")) {
- String temp = messageUnformatted.replace("Party Members:", "").replace(" ●", "").replaceAll("\\s*\\[[^\\]]+\\]", "").trim();
- if (temp.contains(",")) {
- for (int i = 0; i < temp.split(",").length; i++) {
- System.out.println("Added to plist: " + (temp.split(",")[i - 1]));
- Config.partyMembers.add(temp.split(",")[i - 1]);
- }
- }
- else {
- Config.partyMembers.add(temp);
- }
- }
- else if ((message.contains("Party Leader:") && !message.contains(getConfig().getUsername())) || message.equals("You are not currently in a party.") || (message.contains("warped the party into a Skyblock Dungeon") && !message.startsWith(getConfig().getUsername()) || (!message.startsWith("The party was transferred to " + getConfig().getUsername()) && message.startsWith("The party was transferred to"))) || messageUnformatted.endsWith(getConfig().getUsername() + " is now a Party Moderator") || (message.startsWith("The party was disbanded")) || (message.contains("You have joined ") && message.contains("'s party!")) || (message.contains("Party Leader, ") && message.contains(" , summoned you to their server.")) || (message.contains("warped to your dungeon"))) {
- BBsentials.getConfig().setIsLeader(false);
- if (getConfig().isDetailedDevModeEnabled()) {
- sendPrivateMessageToSelfDebug("Leader: " + getConfig().isLeader());
- }
- }
- else if (config.getPlayersInParty().length == 0 && messageUnformatted.endsWith("to the party! They have 60 seconds to accept")) {
- config.setIsLeader(true);
- }
- else if (messageUnformatted.startsWith("You'll be partying with:")) {
- List<String> members = new ArrayList<>();
- for (String users : messageUnformatted.replace("You'll be partying with:", "").replaceAll("\\[[^\\]]*\\]","").trim().split(",")) {
- if (users.contains("and ")){break;}
- members.add(users);
- }
- Config.partyMembers=members;
- }
- else if (((messageUnformatted.startsWith("Party Leader: ") && messageUnformatted.endsWith(getConfig().getUsername() + " ●"))) || (message.contains(getConfig().getUsername() + " warped the party to a SkyBlock dungeon!")) || message.startsWith("The party was transferred to " + getConfig().getUsername()) || message.getUnformattedString().endsWith(" has promoted " + getConfig().getUsername() + " to Party Leader") || (message.contains("warped to your dungeon"))) {
- BBsentials.getConfig().setIsLeader(true);
- if (getConfig().isDetailedDevModeEnabled()) {
- sendPrivateMessageToSelfDebug("Leader: " + getConfig().isLeader());
- }
- }
- else if (message.getUnformattedString().equals("Please type /report confirm to log your report for staff review.")) {
- sendCommand("/report confirm");
- }
- else if (messageUnformatted.startsWith("BUFF! You splashed yourself with")) {
- if (splashStatusUpdateListener != null) {
- splashStatusUpdateListener.setStatus(SplashUpdatePacket.STATUS_SPLASHING);
- }
- }
- }
-
- else if (message.isFromGuild()) {
-
- }
- else if (message.isFromParty()) {
-
- }
- else if (message.isMsg()) {
- if (messageUnformatted.endsWith("bb:party me")) {
- if (BBsentials.getConfig().allowBBinviteMe()) {
- sendCommand("/p " + username);
- }
- }
- }
- else {
- if (message.contains("[OPEN MENU]") || message.contains("[YES]")) {
- setChatPromtId(message.getText().toString());
- }
- }
- }
- }
-
- //{"strikethrough":false,"extra":[{"strikethrough":false,"clickEvent":{"action":"run_command","value":"/viewprofile 4fa1228c-8dd6-47c4-8fe3-b04b580311b8"},"hoverEvent":{"action":"show_text","contents":{"strikethrough":false,"text":"§eClick here to view §bHype_the_Time§e's profile"}},"text":"§9Party §8> §b[MVP§2+§b] Hype_the_Time§f: "},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"text":"h:test"}],"text":""}// {"strikethrough":false,"extra":[{"strikethrough":false,"clickEvent":{"action":"run_command","value":"/viewprofile f772b2c7-bd2a-46e1-b1a2-41fa561157d6"},"hoverEvent":{"action":"show_text","contents":{"strikethrough":false,"text":"§eClick here to view §bShourtu§e's profile"}},"text":"§9Party §8> §b[MVP§c+§b] Shourtu§f: "},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"text":"Hype_the_Time TEST"}],"text":""}
- //{"strikethrough":false,"extra":[{"strikethrough":false,"clickEvent":{"action":"run_command","value":"/viewprofile 4fa1228c-8dd6-47c4-8fe3-b04b580311b8"},"hoverEvent":{"action":"show_text","contents":{"strikethrough":false,"text":"§eClick here to view §bHype_the_Time§e's profile"}},"text":"§9Party §8> §b[MVP§2+§b] Hype_the_Time§f: "},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"text":"h:test"}],"text":""}
- private final Map<String, Instant> partyDisbandedMap = new HashMap<>();
- private String lastPartyDisbandedUsername = null;
-
-
- public boolean isSpam(String message) {
- if (message.contains("Mana")) return true;
- if (message.contains("Status")) return true;
- if (message.contains("Achievement Points")) return true;
- return false;
- }
-
- public String test() {
- //put test code here
- sendNotification("test", "This is an example which was run of the h:test test");
- return new String();
- }
-
- public static void sendPrivateMessageToSelfError(String message) {
- sendPrivateMessageToSelfBase(Formatting.RED + message);
- }
-
- public static void sendPrivateMessageToSelfFatal(String message) {
- sendPrivateMessageToSelfBase(Formatting.DARK_RED + message);
- }
-
- public static void sendPrivateMessageToSelfSuccess(String message) {
- sendPrivateMessageToSelfBase(Formatting.GREEN + message);
- }
-
- public static void sendPrivateMessageToSelfInfo(String message) {
- sendPrivateMessageToSelfBase(Formatting.YELLOW + message);
- }
-
- public static void sendPrivateMessageToSelfImportantInfo(String message) {
- sendPrivateMessageToSelfBase(Formatting.GOLD + message);
- }
-
- public static void sendPrivateMessageToSelfDebug(String message) {
- sendPrivateMessageToSelfBase(Formatting.AQUA + message);
- }
-
- private static void sendPrivateMessageToSelfBase(String message) {
- MinecraftClient client = MinecraftClient.getInstance();
- if (client.player != null) {
- client.player.sendMessage(Text.of(Formatting.RED + message));
- }
- }
-
- public static void sendPrivateMessageToSelfText(Text message) {
- MinecraftClient client = MinecraftClient.getInstance();
- if (client.player != null) {
- client.player.sendMessage(message);
- }
- }
-
- public static void sendCommand(String s) {
- getConfig().sender.addSendTask(s);
- }
-
- public void sendNotification(String title, String text) {
- executionService.execute(() -> {
- try {
- InputStream inputStream = getClass().getResourceAsStream("/sounds/mixkit-sci-fi-confirmation-914.wav");
- AudioInputStream audioInputStream = AudioSystem.getAudioInputStream(inputStream);
- Clip clip = AudioSystem.getClip();
- clip.open(audioInputStream);
- clip.start();
- Thread.sleep(clip.getMicrosecondLength() / 1000);
- clip.close();
- audioInputStream.close();
- } catch (Exception e) {
- e.printStackTrace();
- }
- });
- List<String> argsList = new ArrayList<>();
- argsList.add("--title");
- argsList.add(title);
- argsList.add("--passivepopup");
- argsList.add(text);
- argsList.add("5");
-
- try {
- ProcessBuilder processBuilder = new ProcessBuilder();
- processBuilder.command("kdialog");
- processBuilder.command().addAll(argsList);
-
- Process process = processBuilder.start();
- process.waitFor();
- } catch (IOException | InterruptedException e) {
- e.printStackTrace();
- }
- }
-
- public static Text createClientSideTellraw(String tellrawInput) {
- Text formattedMessage = null;
- try {
- formattedMessage = Text.Serializer.fromJson(tellrawInput);
- } catch (Exception e) {
- e.printStackTrace();
- System.out.println("Invalid Json: \n" + tellrawInput);
- }
- return formattedMessage;
- }
-
- public static void setChatPromtId(String logMessage) {
- String cbUUIDPattern = "/cb ([a-fA-F0-9-]+)";
- Pattern cbPattern = Pattern.compile(cbUUIDPattern);
- Matcher cbMatcher = cbPattern.matcher(logMessage);
-
- String yesClickAction = "/chatprompt ([a-fA-F0-9-]+) YES";
- Pattern yesPattern = Pattern.compile(yesClickAction);
- Matcher yesMatcher = yesPattern.matcher(logMessage);
- String lastPrompt = null;
- if (cbMatcher.find()) {
- lastPrompt = cbMatcher.group(1);
- String finalLastPrompt1 = lastPrompt;
- new Thread(new Runnable() {
- @Override
- public void run() {
- String promptCommand = "/cb " + finalLastPrompt1;
- BBsentials.getConfig().setLastChatPromptAnswer(promptCommand);
- if (config.isDevModeEnabled()) {
- Chat.sendPrivateMessageToSelfDebug("set the last prompt action too + \"" + promptCommand + "\"");
- }
- try {
- Thread.sleep(10 * 1000);
- } catch (InterruptedException e) {
- throw new RuntimeException(e);
- }
- BBsentials.getConfig().setLastChatPromptAnswer(null);
- return;
- }
- }).start();
- }
- if (yesMatcher.find()) {
- lastPrompt = yesMatcher.group(1);
- String finalLastPrompt = lastPrompt;
- new Thread(new Runnable() {
- @Override
- public void run() {
- String promptCommand = "/chatprompt " + finalLastPrompt + " YES";
- getConfig().setLastChatPromptAnswer(promptCommand);
- if (config.isDevModeEnabled()) {
- Chat.sendPrivateMessageToSelfDebug("set the last prompt action too + \"" + promptCommand + "\"");
- }
- try {
- Thread.sleep(10 * 1000);
- } catch (InterruptedException e) {
- throw new RuntimeException(e);
- }
- getConfig().setLastChatPromptAnswer(null);
- return;
- }
- }).start();
-
- }
- }
-
- public static Text replaceAllForText(Text input, String replace, String replaceWith) {
- String text = Text.Serializer.toJson(input);
- if (text.contains(replace)) {
- text = text.replaceAll("\\w{8}-\\w{4}-\\w{4}-\\w{4}-\\w{12}", "");
- }
- text = text.replace(replace, replaceWith);
- Text output = Text.Serializer.fromJson(text);
- return output;
- }
-}
diff --git a/src/main/java/de/hype/bbsentials/chat/Message.java b/src/main/java/de/hype/bbsentials/chat/Message.java
deleted file mode 100644
index 42d1b2e..0000000
--- a/src/main/java/de/hype/bbsentials/chat/Message.java
+++ /dev/null
@@ -1,117 +0,0 @@
-package de.hype.bbsentials.chat;
-
-import de.hype.bbsentials.client.BBsentials;
-import net.minecraft.text.Text;
-
-public class Message {
- public Text text;
- private String unformattedString = null;
- private String playerName = null;
-
- public Message(Text text) {
- this.text = text;
- }
-
- public Text getText() {
- return text;
- }
-
- public String getString() {
- return text.getString();
- }
-
- public String getUnformattedString() {
- if (unformattedString != null) return unformattedString;
- unformattedString = text.getString().replaceAll("§.", "").trim();
- return unformattedString;
- }
-
- public String getMessageContent() {
- if (isServerMessage()) return unformattedString;
- return getUnformattedString().split(":", 2)[1];
- }
-
- Boolean guild = null;
-
- public boolean isFromGuild() {
- if (guild != null) return guild;
- guild = getUnformattedString().startsWith("Guild >");
- return guild;
- }
-
- Boolean party = null;
-
- public boolean isFromParty() {
- if (party != null) return party;
- party = getUnformattedString().startsWith("Party >");
- return party;
- }
-
- Boolean msg = null;
-
- public boolean isMsg() {
- if (msg != null) return msg;
- msg = getUnformattedString().startsWith("From") || getUnformattedString().startsWith("To");
- return msg;
- }
-
- Boolean server = null;
-
- public boolean isServerMessage() {
- if (server != null) return server;
- int space = getUnformattedString().indexOf(" ");
- int doublepoint = getUnformattedString().indexOf(":");
- return ((space + 2 < doublepoint)||doublepoint==-1||space==-1);
- }
-
- public String getPlayerName() {
- if (playerName != null) return playerName;
- playerName = getUnformattedString();
- if (!playerName.contains(":")) {
- playerName = "";
- return "";
- }
- playerName = playerName.split(":", 2)[0];
- if (isMsg()) {
- playerName = playerName.replaceFirst("From", "").replace("To", "").trim();
- }
- if (playerName.contains(">")){
- playerName=playerName.split(">",2)[1];
- }
-// playerName = playerName.replaceFirst("\\[[^\\]]*\\](?:\\s?[^\\x00-\\x7F]?\\s?\\[[^\\]]*\\])*", "").trim()// replaces every [] and unicode character before a asci character.
- playerName = playerName.replaceAll("[^\\x00-\\x7F]","").replaceAll("\\[[^\\]]*\\]","").trim();
- if (playerName.matches("[^a-zA-Z0-9_-]+")) playerName = "";
- return playerName;
- }
-
- public void replaceInJson(String replace, String replaceWith) {
- String textString = toJson();
- textString = textString.replaceFirst(replace, replaceWith);
- text = Text.Serializer.fromJson(textString);
- }
-
- public static Message fromJson(String json) {
- return new Message(Text.Serializer.fromJson(json));
- }
-
- public String toJson() {
- return Text.Serializer.toJson(text);
- }
-
- public boolean isFromReportedUser() {
- return BBsentials.config.alreadyReported.contains(getPlayerName()) && !getPlayerName().isEmpty();
- }
-
- public boolean contains(String string) {
- return getUnformattedString().contains(string);
- }
-
- public boolean startsWith(String string) {
- return getUnformattedString().startsWith(string);
- }
-
- @Override
- public String toString() {
- return getUnformattedString();
- }
-}
diff --git a/src/main/java/de/hype/bbsentials/chat/Sender.java b/src/main/java/de/hype/bbsentials/chat/Sender.java
deleted file mode 100644
index eef2469..0000000
--- a/src/main/java/de/hype/bbsentials/chat/Sender.java
+++ /dev/null
@@ -1,106 +0,0 @@
-package de.hype.bbsentials.chat;
-
-import net.minecraft.client.MinecraftClient;
-import net.minecraft.text.Text;
-import net.minecraft.util.Formatting;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import static de.hype.bbsentials.chat.Chat.sendPrivateMessageToSelfInfo;
-import static de.hype.bbsentials.chat.Chat.sendPrivateMessageToSelfText;
-
-public class Sender {
- private final List<String> sendQueue;
- private final List<Double> sendQueueTiming;
- private final List<Boolean> hidden;
-
-
- public Sender() {
- this.sendQueue = new ArrayList<>();
- this.sendQueueTiming = new ArrayList<>();
- this.hidden = new ArrayList<>();
- startSendingThread();
- }
-
- public void addSendTask(String task, double timing) {
- synchronized (sendQueue) {
- sendPrivateMessageToSelfText(Text.literal(Formatting.GREEN + "Scheduled send-task (as " + sendQueueTiming.size() + " in line): " + task + " | Delay: " + timing));
- sendQueueTiming.add(timing);
- sendQueue.add(task);
- hidden.add(false);
- sendQueue.notify(); // Notify the waiting thread that a new String has been added
- }
- }
-
- public void addHiddenSendTask(String task, double timing) {
- synchronized (sendQueue) {
- sendQueueTiming.add(timing);
- sendQueue.add(task);
- hidden.add(true);
-
- sendQueue.notify(); // Notify the waiting thread that a new String has been added
- }
- }
-
- public void addImmediateSendTask(String task) {
- synchronized (sendQueue) {
- sendQueueTiming.add(0, 0.0);
- sendQueue.add(0, task);
- hidden.add(false);
-
- sendQueue.notify(); // Notify the waiting thread that a new String has been added
- }
- }
-
- public void addSendTask(String task) {
- addSendTask(task, 1);
- }
-
- public void startSendingThread() {
- Thread sendingThread = new Thread(new SendingRunnable());
- sendingThread.start();
- }
-
- private class SendingRunnable implements Runnable {
- @Override
- public void run() {
- while (true) {
- String task = getNextTask();
- if (task != null) {
- send(task, sendQueueTiming.remove(0), hidden.remove(0));
- }
- else {
- synchronized (sendQueue) {
- try {
- sendQueue.wait(); // Wait for new Send
- } catch (InterruptedException e) {
- throw new RuntimeException(e);
- }
- }
- }
- }
- }
-
- private String getNextTask() {
- synchronized (sendQueue) {
- if (!sendQueue.isEmpty()) {
- return sendQueue.remove(0);
- }
- return null;
- }
- }
-
- private void send(String toSend, double timing, boolean hidden) {
- try {
- Thread.sleep((long) (timing * 1000)); // Simulate the send operation
- } catch (InterruptedException e) {
- throw new RuntimeException(e);
- }
- MinecraftClient.getInstance().getNetworkHandler().sendChatMessage(toSend);
- if (!hidden) {
- sendPrivateMessageToSelfInfo("Sent Command to Server: " + toSend);
- }
- }
- }
-}
diff --git a/src/main/java/de/hype/bbsentials/client/BBUtils.java b/src/main/java/de/hype/bbsentials/client/BBUtils.java
deleted file mode 100644
index 1b35fa6..0000000
--- a/src/main/java/de/hype/bbsentials/client/BBUtils.java
+++ /dev/null
@@ -1,66 +0,0 @@
-package de.hype.bbsentials.client;
-
-import com.google.common.collect.Lists;
-import de.hype.bbsentials.chat.Chat;
-import de.hype.bbsentials.constants.enviromentShared.Islands;
-import net.minecraft.client.MinecraftClient;
-import net.minecraft.client.network.PlayerListEntry;
-
-import java.util.Iterator;
-import java.util.List;
-
-public class BBUtils {
- public static Islands getCurrentIsland() {
- try {
- String string = MinecraftClient.getInstance().player.networkHandler.getPlayerListEntry("!C-b").getDisplayName().getString();
- if (!string.startsWith("Area: ")) {
- Chat.sendPrivateMessageToSelfError("Could not get Area data. Are you in Skyblock?");
- }
- else {
- return Islands.getByDisplayName(string.replace("Area: ", "").trim());
- }
- } catch (Exception e) {
- }
- return null;
- }
-
- public static int getPlayerCount() {
- return Integer.parseInt(MinecraftClient.getInstance().player.networkHandler.getPlayerListEntry("!B-a").getDisplayName().getString().trim().replaceAll("[^0-9]", ""));
- }
-
- public static String getServer() {
- return MinecraftClient.getInstance().player.networkHandler.getPlayerListEntry("!C-c").getDisplayName().getString().replace("Server:", "").trim();
- }
-
- public static boolean isOnMegaServer() {
- return getServer().toLowerCase().startsWith("mega");
- }
-
- public static boolean isOnMiniServer() {
- return getServer().toLowerCase().startsWith("mini");
- }
-
- public static int getMaximumPlayerCount() {
- boolean mega = isOnMegaServer();
- Islands island = getCurrentIsland();
- if (island == null) return 100;
- if (island.equals(Islands.HUB)) {
- if (mega) return 80;
- else return 24;
- }
- return 24;
- }
-
- public List<String> getPlayers() {
- List<String> list = Lists.newArrayList();
- Iterator var2 = MinecraftClient.getInstance().getNetworkHandler().getPlayerList().iterator();
- while (var2.hasNext()) {
- PlayerListEntry playerListEntry = (PlayerListEntry) var2.next();
- String playerName = playerListEntry.getProfile().getName();
- if (!playerName.startsWith("!")) {
- list.add(playerName);
- }
- }
- return list;
- }
-}
diff --git a/src/main/java/de/hype/bbsentials/client/BBsentials.java b/src/main/java/de/hype/bbsentials/client/BBsentials.java
deleted file mode 100644
index fe51139..0000000
--- a/src/main/java/de/hype/bbsentials/client/BBsentials.java
+++ /dev/null
@@ -1,261 +0,0 @@
-package de.hype.bbsentials.client;
-
-import com.mojang.brigadier.arguments.StringArgumentType;
-import de.hype.bbsentials.api.Options;
-import de.hype.bbsentials.chat.Chat;
-import de.hype.bbsentials.client.Commands.CommandsOLD;
-import de.hype.bbsentials.communication.BBsentialConnection;
-import net.fabricmc.api.ClientModInitializer;
-import net.fabricmc.fabric.api.client.command.v2.ClientCommandManager;
-import net.fabricmc.fabric.api.client.command.v2.ClientCommandRegistrationCallback;
-import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
-import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper;
-import net.fabricmc.fabric.api.client.networking.v1.ClientPlayConnectionEvents;
-import net.minecraft.client.MinecraftClient;
-import net.minecraft.client.option.KeyBinding;
-import net.minecraft.client.util.InputUtil;
-import net.minecraft.command.CommandSource;
-import org.lwjgl.glfw.GLFW;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.Executors;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.TimeUnit;
-
-import static de.hype.bbsentials.chat.Chat.*;
-
-public class BBsentials implements ClientModInitializer {
- public static Config config;
- public static BBsentialConnection connection;
- public static CommandsOLD coms;
- public static ScheduledExecutorService executionService = Executors.newScheduledThreadPool(1000);
- public static boolean splashLobby;
- private static Thread bbthread;
- private boolean initialised = false;
- public static SplashStatusUpdateListener splashStatusUpdateListener;
-
- public static Config getConfig() {
- return config;
- }
-
- public static void connectToBBserver() {
- connectToBBserver(config.connectToBeta);
- }
-
- /**
- * Checks if still connected to the Server.
- *
- * @return true if it connected; false if old connection is kept.
- */
- public static boolean conditionalReconnectToBBserver() {
- if (!connection.isConnected()) {
- Chat.sendPrivateMessageToSelfInfo("Reconnecting");
- connectToBBserver(config.connectToBeta);
- return true;
- }
- return false;
- }
-
- public static void connectToBBserver(boolean beta) {
- if (connection != null) {
- connection.sendHiddenMessage("exit");
- }
- if (bbthread != null) {
- if (bbthread.isAlive()) {
- bbthread.interrupt();
- }
- }
- bbthread = new Thread(() -> {
- connection = new BBsentialConnection();
- coms = new CommandsOLD();
- connection.setMessageReceivedCallback(message -> executionService.execute(() -> connection.onMessageReceived(message)));
- if (beta) {
- connection.connect(config.getBBServerURL(), 5011);
- }
- else {
- connection.connect(config.getBBServerURL(), 5000);
- }
- executionService.scheduleAtFixedRate(new DebugThread(), 0, 20, TimeUnit.SECONDS);
- });
- bbthread.start();
- }
-
- /**
- * Runs the mod initializer on the client environment.
- */
-
- @Override
- public void onInitializeClient() {
- ClientPlayConnectionEvents.JOIN.register((a, b, c) -> {
- splashLobby = false;
- if (!initialised) {
- config = Config.load();
- if (config.doGammaOverride) Options.setGamma(10);
- Chat chat = new Chat();
- if (Config.isBingoTime() || config.overrideBingoTime()) {
- connectToBBserver();
- }
- initialised = true;
- }
- });
- }
-
- {
- ClientCommandRegistrationCallback.EVENT.register((dispatcher, registryAccess) -> {
- dispatcher.register(ClientCommandManager.literal("bbi")
- .then(ClientCommandManager.literal("reconnect")
- .executes((context) -> {
- connectToBBserver();
- return 1;
- }))
- .then(ClientCommandManager.literal("reconnect-stable-server")
- .executes((context) -> {
- connectToBBserver(false);
- return 1;
- }))
- .then(ClientCommandManager.literal("reconnect-test-server")
- .executes((context) -> {
- connectToBBserver(true);
- return 1;
- }))
- .then(ClientCommandManager.literal("config")
- .then(ClientCommandManager.argument("category", StringArgumentType.string())
- .suggests((context, builder) -> {
- // Provide tab-completion options for config subfolder
- return CommandSource.suggestMatching(new String[]{"save", "reset", "load"}, builder);
- }).executes((context) -> {
- String category = StringArgumentType.getString(context, "category");
- switch (category) {
- case "save":
- getConfig().save();
- sendPrivateMessageToSelfSuccess("Saved config successfully");
- break;
- case "load":
- BBsentials.config = Config.load();
- break;
- case "reset":
- // Reset logic here
- break;
- }
- return 1;
- }))
- .then(ClientCommandManager.literal("set-value")
- .then(ClientCommandManager.argument("className", StringArgumentType.string())
- .suggests((context, builder) -> {
- // Provide tab-completion options for classes
- ArrayList<String> classNames = new ArrayList<>();
- classNames.add("Config");
- // Replace with your own logic to retrieve class names
- return CommandSource.suggestMatching(classNames, builder);
- })
- .then(ClientCommandManager.argument("variableName", StringArgumentType.string())
- .suggests((context, builder) -> {
- // Provide tab-completion options for variable names
- List<String> variableNames;
- variableNames = List.of(getVariableInfo("de.hype.bbsentials.client", "Config"));
- return CommandSource.suggestMatching(variableNames, builder);
- })
- .then(ClientCommandManager.argument("variableValue", StringArgumentType.string())
- .executes((context) -> {
- // Handle "variableName" and "variableValue" logic here
- String variableName = StringArgumentType.getString(context, "variableName");
- String variableValue = StringArgumentType.getString(context, "variableValue");
- try {
- if (!variableName.toLowerCase().contains("dev") || config.hasBBRoles("dev")) {
- setVariableValue(getConfig(), variableName, variableValue);
- }
- getConfig().save();
- } catch (ClassNotFoundException |
- NoSuchFieldException |
- IllegalAccessException |
- InstantiationException |
- InvocationTargetException |
- NoSuchMethodException e) {
- Chat.sendPrivateMessageToSelfError("Invalid variable or value");
- }
- return 1;
- })))))
- .then(ClientCommandManager.literal("get-value")
- .then(ClientCommandManager.argument("className", StringArgumentType.string())
- .suggests((context, builder) -> {
- // Provide tab-completion options for classes
- ArrayList<String> classNames = new ArrayList<>();
- classNames.add("Config");
- // Replace with your own logic to retrieve class names
- return CommandSource.suggestMatching(classNames, builder);
- })
- .then(ClientCommandManager.argument("variableName", StringArgumentType.string())
- .suggests((context, builder) -> {
- // Provide tab-completion options for variable names
- List<String> variableNames;
- variableNames = List.of(getVariableInfo("de.hype.bbsentials.client", "Config"));
- return CommandSource.suggestMatching(variableNames, builder);
- })
- .executes((context) -> {
- // Handle "variableName" and "variableValue" logic here
- String variableName = StringArgumentType.getString(context, "variableName");
- try {
- Chat.getVariableValue(getConfig(), variableName);
- } catch (Exception e) {
- e.printStackTrace();
- }
- return 1;
- }))).executes((context) -> {
- // Handle the case when "config" argument is not provided
- // ...
- return 1;
- })))
- );
- }); //bbi
-
- KeyBinding devKeyBind = new KeyBinding("Open Mod Menu Config", InputUtil.Type.KEYSYM, GLFW.GLFW_KEY_KP_ADD, "BBsentials: Developing Tools");
- KeyBindingHelper.registerKeyBinding(devKeyBind);
- ClientTickEvents.END_CLIENT_TICK.register(client -> {
- if (devKeyBind.wasPressed()) {
- MinecraftClient.getInstance().setScreen(BBsentialsConfigScreemFactory.create(MinecraftClient.getInstance().currentScreen));
- }
- });
-
- KeyBinding promptKeyBind = new KeyBinding("Chat Prompt Yes / Open Menu", InputUtil.Type.KEYSYM, GLFW.GLFW_KEY_R, "BBsentials");
- KeyBindingHelper.registerKeyBinding(promptKeyBind);
- ClientTickEvents.END_CLIENT_TICK.register(client -> {
- if (promptKeyBind.wasPressed()) {
- if (config.getLastChatPromptAnswer() != null) {
- if (config.isDetailedDevModeEnabled()) {
- Chat.sendPrivateMessageToSelfDebug(config.getLastChatPromptAnswer());
- }
- MinecraftClient.getInstance().getNetworkHandler().sendChatMessage(config.getLastChatPromptAnswer());
- }
- config.setLastChatPromptAnswer(null);
- }
- });
- KeyBinding craftKeyBind = new KeyBinding("Craft", InputUtil.Type.KEYSYM, GLFW.GLFW_KEY_V, "BBsentials");
- KeyBindingHelper.registerKeyBinding(craftKeyBind);
- ClientTickEvents.END_CLIENT_TICK.register(client -> {
- if (craftKeyBind.wasPressed()) MinecraftClient.getInstance().getNetworkHandler().sendChatMessage("/craft");
- });
- KeyBinding petKeyBind = new KeyBinding("Open Pet Menu", InputUtil.Type.KEYSYM, -1, "BBsentials");
- KeyBindingHelper.registerKeyBinding(petKeyBind);
- ClientTickEvents.END_CLIENT_TICK.register(client -> {
- if (petKeyBind.wasPressed()) MinecraftClient.getInstance().getNetworkHandler().sendChatMessage("/pets");
- });
- for (int i = 1; i <= 9; i++) {
- KeyBinding ecPageKeyBind = new KeyBinding("Ender Chest Page " + i, InputUtil.Type.KEYSYM, GLFW.GLFW_KEY_KP_1 + (i - 1), "BBsentials");
- KeyBindingHelper.registerKeyBinding(ecPageKeyBind);
- int pageNum = i; // Capture the page number for lambda
- ClientTickEvents.END_CLIENT_TICK.register(client -> {
- if (ecPageKeyBind.wasPressed()) {
- BBsentials.getConfig().sender.addImmediateSendTask("/ec " + pageNum);
- }
- });
- }
- } // KeyBinds
-
- public void manualLoad() {
- initialised = true;
- config = Config.load();
- connectToBBserver();
- }
-} \ No newline at end of file
diff --git a/src/main/java/de/hype/bbsentials/client/BBsentialsConfigScreemFactory.java b/src/main/java/de/hype/bbsentials/client/BBsentialsConfigScreemFactory.java
deleted file mode 100644
index d078b46..0000000
--- a/src/main/java/de/hype/bbsentials/client/BBsentialsConfigScreemFactory.java
+++ /dev/null
@@ -1,304 +0,0 @@
-package de.hype.bbsentials.client;
-
-import de.hype.bbsentials.constants.enviromentShared.Islands;
-import me.shedaniel.clothconfig2.api.ConfigBuilder;
-import me.shedaniel.clothconfig2.api.ConfigCategory;
-import me.shedaniel.clothconfig2.api.ConfigEntryBuilder;
-import me.shedaniel.clothconfig2.api.Requirement;
-import me.shedaniel.clothconfig2.gui.entries.BooleanListEntry;
-import me.shedaniel.clothconfig2.gui.entries.DropdownBoxEntry;
-import me.shedaniel.clothconfig2.gui.entries.StringListEntry;
-import me.shedaniel.clothconfig2.impl.builders.SubCategoryBuilder;
-import net.minecraft.client.MinecraftClient;
-import net.minecraft.client.gui.screen.NoticeScreen;
-import net.minecraft.client.gui.screen.Screen;
-import net.minecraft.text.Text;
-
-import java.util.List;
-
-import static de.hype.bbsentials.client.BBsentials.config;
-
-public class BBsentialsConfigScreemFactory {
- public static Screen create(Screen parent) {
- if (BBsentials.config == null) {
- return new NoticeScreen(() -> MinecraftClient.getInstance().setScreen(parent), Text.of("BBsentials"), Text.of("You need to login to a Server for the Config to be loaded."));
- }
- else {
- ConfigBuilder builder = ConfigBuilder.create()
- .setParentScreen(parent)
- .setTitle(Text.of("BBsentials Config"));
- builder.setSavingRunnable(BBsentials.getConfig()::save);
- ConfigEntryBuilder entryBuilder = builder.entryBuilder();
- ConfigCategory server = builder.getOrCreateCategory(Text.of("Server"));
- if (config.getUsername().equalsIgnoreCase("Hype_the_Time")) {
- server.addEntry(entryBuilder.startTextField(Text.of("Server URL"), config.getBBServerURL().replaceAll(".", "*"))
- .setDefaultValue("localhost")
- .setTooltip(Text.of("Place the Server URL of the BBsentials Server here"))
- .setSaveConsumer((newValue) -> {
- if (newValue.replace("*", "").trim().isEmpty()) {
- return;
- }
- else {
- config.bbServerURL = newValue;
- }
- })
- .build());
- }
- else {
- server.addEntry(entryBuilder.startTextField(Text.of("Server URL"), config.getBBServerURL())
- .setDefaultValue("localhost")
- .setTooltip(Text.of("Place the Server URL of the BBsentials Server here"))
- .setSaveConsumer(newValue -> config.bbServerURL = newValue)
- .build());
- }
- server.addEntry(entryBuilder.startStrField(Text.of("BBsentials API key"), config.apiKey.replaceAll(".", "*"))
- .setDefaultValue("unset")
- .setTooltip(Text.of("Put you API Key here (the one generated in the Discord! with /link). §cThe Text is visually censored. Not saved unless you changed it."))
- .setSaveConsumer((newValue) -> {
- if (newValue.replace("*", "").trim().isEmpty()) {
- return;
- }
- else {
- config.apiKey = newValue;
- }
- })
- .build());
- server.addEntry(entryBuilder.startBooleanToggle(Text.of("Connect to Test Server"), config.connectToBeta)
- .setDefaultValue(false)
- .setTooltip(Text.of("Makes you connect to the Test Server instead of the Main Server. Keep in mind that all announces may be tests and the main announces are not transferred over to here!")) // Optional: Shown when the user hover over this option
- .setSaveConsumer(newValue -> config.connectToBeta = newValue)
- .build());
- server.addEntry(entryBuilder.startBooleanToggle(Text.of("Override Bingo Time"), config.overrideBingoTime)
- .setDefaultValue(false)
- .setTooltip(Text.of("Override the Bingo Time and connect always to the Server. (Bingo time is 14 days cause Extreme Bingo)"))
- .setSaveConsumer(newValue -> config.overrideBingoTime = newValue)
- .build());
- server.addEntry(entryBuilder.startBooleanToggle(Text.of("Allow Server Partying"), config.allowServerPartyInvite)
- .setDefaultValue(true)
- .setTooltip(Text.of("Allow the Server to party players for you automatically. (Convenience Feature. Is used for example for services to automatically party the persons which joined it)"))
- .setSaveConsumer(newValue -> config.allowServerPartyInvite = newValue)
- .build());
- //Visual
- ConfigCategory visual = builder.getOrCreateCategory(Text.of("Visual"));
- visual.addEntry(entryBuilder.startBooleanToggle(Text.of("Show Bingo Chat"), config.showBingoChat)
- .setDefaultValue(true)
- .setTooltip(Text.of("Select if you want the Bingo Chat to be show"))
- .setSaveConsumer(newValue -> config.showBingoChat = newValue)
- .build());
- visual.addEntry(entryBuilder.startBooleanToggle(Text.of("Show Splash Status Updates"), config.showSplashStatusUpdates)
- .setDefaultValue(true)
- .setTooltip(Text.of("Select if you want to see Splash Staus updates. Keep in mind that this will only send you status updates for the Splashes which you were shown.\nThose hidden due too too high Splash Time will still remain invisible"))
- .setSaveConsumer(newValue -> config.showSplashStatusUpdates = newValue)
- .build());
- //Notifications
- ConfigCategory notifications = builder.getOrCreateCategory(Text.of("Notifications"));
- BooleanListEntry doNotifications = entryBuilder.startBooleanToggle(Text.of("Do Desktop Notifications"), config.doDesktopNotifications)
- .setDefaultValue(true)
- .setTooltip(Text.of("Select if you want BBsentials to automatically accept reparties"))
- .setSaveConsumer(newValue -> config.doDesktopNotifications = newValue)
- .build();
- DropdownBoxEntry<String> notificationOn = entryBuilder.startStringDropdownMenu(Text.of("Notification on"), config.notifForMessagesType) // Start the StringDropdownMenu entry
- .setSelections(List.of("all", "nick", "none"))
- .setTooltip(Text.of("When do you want to receive Desktop Notifications? on all party, messages containing nickname"))
- .setDefaultValue("all")
- .setRequirement(Requirement.isTrue(doNotifications))
- .setSuggestionMode(false)
- .setSaveConsumer(newValue -> config.notifForMessagesType = newValue)
- .build();
- StringListEntry nickname = entryBuilder.startStrField(Text.of("Nickname"), config.nickname)
- .setDefaultValue("")
- .setTooltip(Text.of("Nickname. you will get send desktop notifications if a message contains one"))
- .setRequirement(() -> {
- return doNotifications.getValue() && notificationOn.getValue().equals("nick");
- })
- .setSaveConsumer(newValue -> config.nickname = newValue)
- .build();
-
- notifications.addEntry(doNotifications);
- notifications.addEntry(notificationOn);
- notifications.addEntry(nickname);
- //other
- ConfigCategory other = builder.getOrCreateCategory(Text.of("Other"));
- other.addEntry(entryBuilder.startBooleanToggle(Text.of("Gamma Override"), config.doGammaOverride)
- .setDefaultValue(true)
- .setTooltip(Text.of("Select if you want BBsentials to enable full bright"))
- .setSaveConsumer(newValue -> config.doGammaOverride = newValue)
- .build());
- other.addEntry(entryBuilder.startBooleanToggle(Text.of("Accept Reparties"), config.acceptReparty)
- .setDefaultValue(true)
- .setTooltip(Text.of("Select if you want BBsentials to automatically accept reparties"))
- .setSaveConsumer(newValue -> config.showBingoChat = newValue)
- .build());
- other.addEntry(entryBuilder.startBooleanToggle(Text.of("Accept auto invite"), config.allowBBinviteMe)
- .setDefaultValue(true)
- .setTooltip(Text.of("Do you want that whenever someone sends you a msg ending with 'bb:party me' to send them a party invite automatically?"))
- .setSaveConsumer(newValue -> config.allowBBinviteMe = newValue)
- .build());
- ConfigCategory chChestItems = builder.getOrCreateCategory(Text.of("Ch Chest Items"));
- {
- BooleanListEntry allItems = entryBuilder.startBooleanToggle(Text.of("All Chest Items"), config.toDisplayConfig.allChChestItem)
- .setDefaultValue(true)
- .setTooltip(Text.of("Select to receive notifications when an any Item is found"))
- .setSaveConsumer(newValue -> config.toDisplayConfig.allChChestItem = newValue)
- .build();
- chChestItems.addEntry(allItems);
- Requirement notAllItemsRequirement = () -> !allItems.getValue();
- chChestItems.addEntry(entryBuilder.startBooleanToggle(Text.of("ALL Robo Parts "), config.toDisplayConfig.allRoboPart)
- .setDefaultValue(false)
- .setTooltip(Text.of("Select to receive notifications when an allRoboPartCustomChChestItem is found"))
- .setSaveConsumer(newValue -> config.toDisplayConfig.allRoboPart = newValue)
- .setRequirement(notAllItemsRequirement)
- .build());
- BooleanListEntry allRoboParts = (entryBuilder.startBooleanToggle(Text.of("Custom (Other) Items"), config.toDisplayConfig.customChChestItem)
- .setDefaultValue(false)
- .setTooltip(Text.of("Select to receive notifications when any not already defined Item is found"))
- .setSaveConsumer(newValue -> config.toDisplayConfig.customChChestItem = newValue)
- .setRequirement(notAllItemsRequirement)
- .build());
- chChestItems.addEntry(allRoboParts);
- Requirement notAllRoboPartsRequirement = () -> !allRoboParts.getValue();
- chChestItems.addEntry(entryBuilder.startBooleanToggle(Text.of("Prehistoric Egg"), config.toDisplayConfig.prehistoricEgg)
- .setDefaultValue(false)
- .setTooltip(Text.of("Select to receive notifications when a Prehistoric Egg is found"))
- .setSaveConsumer(newValue -> config.toDisplayConfig.prehistoricEgg = newValue)
- .setRequirement(notAllItemsRequirement)
- .build());
-
- chChestItems.addEntry(entryBuilder.startBooleanToggle(Text.of("Pickonimbus 2000"), config.toDisplayConfig.pickonimbus2000)
- .setDefaultValue(false)
- .setTooltip(Text.of("Select to receive notifications when a Pickonimbus 2000 is found"))
- .setSaveConsumer(newValue -> config.toDisplayConfig.pickonimbus2000 = newValue)
- .setRequirement(notAllItemsRequirement)
- .build());
- SubCategoryBuilder roboParts = entryBuilder.startSubCategory(Text.of("Robo Parts")).setRequirement(Requirement.all(notAllRoboPartsRequirement, notAllItemsRequirement)).setExpanded(true);
- roboParts.add(entryBuilder.startBooleanToggle(Text.of("Control Switch"), config.toDisplayConfig.controlSwitch)
- .setDefaultValue(false)
- .setTooltip(Text.of("Select to receive notifications when a Control Switch is found"))
- .setSaveConsumer(newValue -> config.toDisplayConfig.controlSwitch = newValue)
- .build());
-
- roboParts.add(entryBuilder.startBooleanToggle(Text.of("Electron Transmitter"), config.toDisplayConfig.electronTransmitter)
- .setDefaultValue(false)
- .setTooltip(Text.of("Select to receive notifications when an Electron Transmitter is found"))
- .setSaveConsumer(newValue -> config.toDisplayConfig.electronTransmitter = newValue)
- .build());
-
- roboParts.add(entryBuilder.startBooleanToggle(Text.of("FTX 3070"), config.toDisplayConfig.ftx3070)
- .setDefaultValue(false)
- .setTooltip(Text.of("Select to receive notifications when a FTX 3070 is found"))
- .setSaveConsumer(newValue -> config.toDisplayConfig.ftx3070 = newValue)
- .build());
-
- roboParts.add(entryBuilder.startBooleanToggle(Text.of("Robotron Reflector"), config.toDisplayConfig.robotronReflector)
- .setDefaultValue(false)
- .setTooltip(Text.of("Select to receive notifications when a Robotron Reflector is found"))
- .setSaveConsumer(newValue -> config.toDisplayConfig.robotronReflector = newValue)
- .build());
-
- roboParts.add(entryBuilder.startBooleanToggle(Text.of("Superlite Motor"), config.toDisplayConfig.superliteMotor)
- .setDefaultValue(false)
- .setTooltip(Text.of("Select to receive notifications when a Superlite Motor is found"))
- .setSaveConsumer(newValue -> config.toDisplayConfig.superliteMotor = newValue)
- .build());
-
- roboParts.add(entryBuilder.startBooleanToggle(Text.of("Synthetic Heart"), config.toDisplayConfig.syntheticHeart)
- .setDefaultValue(false)
- .setTooltip(Text.of("Select to receive notifications when a Synthetic Heart is found"))
- .setSaveConsumer(newValue -> config.toDisplayConfig.syntheticHeart = newValue)
- .build());
- chChestItems.addEntry(roboParts.build());
- chChestItems.addEntry(entryBuilder.startBooleanToggle(Text.of("Flawless Gemstone"), config.toDisplayConfig.flawlessGemstone)
- .setDefaultValue(false)
- .setTooltip(Text.of("Select to receive notifications when any Flawless Gemstone is found"))
- .setSaveConsumer(newValue -> config.toDisplayConfig.flawlessGemstone = newValue)
- .setRequirement(notAllItemsRequirement)
- .build());
- chChestItems.addEntry(entryBuilder.startBooleanToggle(Text.of("Jungle Heart"), config.toDisplayConfig.jungleHeart)
- .setDefaultValue(false)
- .setTooltip(Text.of("Select to receive notifications when a JungleHeart is found"))
- .setSaveConsumer(newValue -> config.toDisplayConfig.jungleHeart = newValue)
- .setRequirement(notAllItemsRequirement)
- .build());
- }//CHChestItems
- ConfigCategory miningEvents = builder.getOrCreateCategory(Text.of("Mining Events"));
- {
- BooleanListEntry allEvents = entryBuilder.startBooleanToggle(Text.of("All Events"), config.toDisplayConfig.allEvents)
- .setDefaultValue(true)
- .setTooltip(Text.of("Get updated for any Mining Event"))
- .setSaveConsumer(newValue -> config.toDisplayConfig.allEvents = newValue)
- .build();
- miningEvents.addEntry(allEvents);
- miningEvents.addEntry(entryBuilder.startBooleanToggle(Text.of("§cBlock Crystal Hollow Events"), config.toDisplayConfig.blockChEvents)
- .setDefaultValue(false)
- .setTooltip(Text.of("Block getting Crystal Hollow Events. Maybe if you haven't accessed Crystal Hollows yet "))
- .setSaveConsumer(newValue -> config.toDisplayConfig.blockChEvents = newValue)
- .build());
- miningEvents.addEntry(entryBuilder.startStringDropdownMenu(Text.of("Gone with the Wind"), config.toDisplayConfig.goneWithTheWind) // Start the StringDropdownMenu entry
- .setSelections(List.of("both", Islands.DWARVEN_MINES.getDisplayName(), Islands.CRYSTAL_HOLLOWS.getDisplayName(), "none"))
- .setTooltip(Text.of("Get notified when a Gone with the Wind happens in the specified Island"))
- .setDefaultValue("none")
- .setSuggestionMode(false)
- .setRequirement(() -> !allEvents.getValue())
- .setSaveConsumer(newValue -> config.toDisplayConfig.goneWithTheWind = newValue)
- .build());
- miningEvents.addEntry(entryBuilder.startStringDropdownMenu(Text.of("Better Together"), config.toDisplayConfig.betterTogether) // Start the StringDropdownMenu entry
- .setSelections(List.of("both", Islands.DWARVEN_MINES.getDisplayName(), Islands.CRYSTAL_HOLLOWS.getDisplayName(), "none"))
- .setTooltip(Text.of("Get notified when a Better Together happens in the specified Island"))
- .setDefaultValue("none")
- .setSuggestionMode(false)
- .setRequirement(() -> !allEvents.getValue())
- .setSaveConsumer(newValue -> config.toDisplayConfig.betterTogether = newValue)
- .build());
- miningEvents.addEntry(entryBuilder.startStringDropdownMenu(Text.of("Double Powder"), config.toDisplayConfig.doublePowder) // Start the StringDropdownMenu entry
- .setSelections(List.of("both", Islands.DWARVEN_MINES.getDisplayName(), Islands.CRYSTAL_HOLLOWS.getDisplayName(), "none"))
- .setTooltip(Text.of("Get notified when a Double Powder happens in the specified Island"))
- .setDefaultValue("none")
- .setRequirement(() -> !allEvents.getValue())
- .setSuggestionMode(false)
- .setSaveConsumer(newValue -> config.toDisplayConfig.doublePowder = newValue)
- .build());
- miningEvents.addEntry(entryBuilder.startBooleanToggle(Text.of("Mithril Gourmand"), config.toDisplayConfig.mithrilGourmand)
- .setDefaultValue(false)
- .setTooltip(Text.of("Get notified when a Mithril Gourmand happens"))
- .setRequirement(() -> !allEvents.getValue())
- .setSaveConsumer(newValue -> config.toDisplayConfig.mithrilGourmand = newValue)
- .build());
- miningEvents.addEntry(entryBuilder.startBooleanToggle(Text.of("Raffle"), config.toDisplayConfig.raffle)
- .setDefaultValue(false)
- .setTooltip(Text.of("Get notified when a Raffle happens"))
- .setSaveConsumer(newValue -> config.toDisplayConfig.raffle = newValue)
- .setRequirement(() -> !allEvents.getValue())
- .build());
- miningEvents.addEntry(entryBuilder.startBooleanToggle(Text.of("Goblin Raid"), config.toDisplayConfig.goblinRaid)
- .setDefaultValue(false)
- .setTooltip(Text.of("Get notified when a Goblin Raid happens"))
- .setSaveConsumer(newValue -> config.toDisplayConfig.goblinRaid = newValue)
- .setRequirement(() -> !allEvents.getValue())
- .build());
- } //Mining Events
- if (config.hasBBRoles("dev")) {
- ConfigCategory dev = builder.getOrCreateCategory(Text.of("§3Developing"));
- dev.addEntry(entryBuilder.startBooleanToggle(Text.of("Dev Mode"), config.devMode)
- .setDefaultValue(false)
- .setTooltip(Text.of("Dev Mode"))
- .setSaveConsumer(newValue -> config.devMode = newValue)
- .build());
- dev.addEntry(entryBuilder.startBooleanToggle(Text.of("Detailed Dev Mode"), config.detailedDevMode)
- .setDefaultValue(false)
- .setTooltip(Text.of("Detailed Dev Mode"))
- .setSaveConsumer(newValue -> config.detailedDevMode = newValue)
- .build());
- }
- if (config.hasBBRoles("splasher")) {
- ConfigCategory dev = builder.getOrCreateCategory(Text.of("§dSplashes"));
- dev.addEntry(entryBuilder.startBooleanToggle(Text.of("Auto Update Statuses"), config.autoSplashStatusUpdates)
- .setDefaultValue(true)
- .setTooltip(Text.of("Automatically updates the Status of the Splash by sending packets to the Server"))
- .setSaveConsumer(newValue -> config.autoSplashStatusUpdates = newValue)
- .build());
- }
-
- return builder.build();
- }
- }
-}
diff --git a/src/main/java/de/hype/bbsentials/client/Commands/CommandsOLD.java b/src/main/java/de/hype/bbsentials/client/Commands/CommandsOLD.java
deleted file mode 100644
index d42dc8d..0000000
--- a/src/main/java/de/hype/bbsentials/client/Commands/CommandsOLD.java
+++ /dev/null
@@ -1,365 +0,0 @@
-package de.hype.bbsentials.client.Commands;
-
-import com.mojang.brigadier.CommandDispatcher;
-import com.mojang.brigadier.arguments.IntegerArgumentType;
-import com.mojang.brigadier.arguments.StringArgumentType;
-import de.hype.bbsentials.chat.Chat;
-import de.hype.bbsentials.client.BBUtils;
-import de.hype.bbsentials.client.BBsentials;
-import de.hype.bbsentials.constants.enviromentShared.ChChestItems;
-import de.hype.bbsentials.constants.enviromentShared.MiningEvents;
-import de.hype.bbsentials.packets.AbstractPacket;
-import de.hype.bbsentials.packets.packets.*;
-import net.fabricmc.fabric.api.client.command.v2.ClientCommandManager;
-import net.fabricmc.fabric.api.client.command.v2.ClientCommandRegistrationCallback;
-import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource;
-import net.fabricmc.fabric.api.event.Event;
-import net.minecraft.command.CommandSource;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Objects;
-
-import static de.hype.bbsentials.client.BBsentials.*;
-
-public class CommandsOLD {
- public CommandsOLD() {
- Event<ClientCommandRegistrationCallback> event = ClientCommandRegistrationCallback.EVENT;
- event.register((dispatcher, registryAccess) -> {
- dispatcher.register(ClientCommandManager.literal("creport")
- .then(ClientCommandManager.argument("Player_Name", StringArgumentType.string())
- .executes((context) -> {
- String playerName = StringArgumentType.getString(context, "Player_Name");
- getConfig().sender.addSendTask("/creport " + playerName, 0);
- getConfig().addReported(playerName);
- return 1;
- })));
- });//creport helper → no double report during same launch
- event.register((dispatcher, registryAccess) -> {
- dispatcher.register(ClientCommandManager.literal("socialoptions")
- .then(ClientCommandManager.argument("playername", StringArgumentType.greedyString())
- .executes((context) -> {
- String[] parameters = StringArgumentType.getString(context, "playername").trim().split(" ", 3);
- Chat.sendPrivateMessageToSelfDebug(String.join(" ", parameters));
- String tellrawjson = "";
- if (parameters.length >= 3) {
- if (parameters[0].equals("sb")) {
- tellrawjson = "[\"\",{\"text\":\"\n\n$username\",\"underlined\":true,\"color\":\"blue\",\"clickEvent\":{\"action\":\"copy_to_clipboard\",\"value\":\"$username\"},\"hoverEvent\":{\"action\":\"show_text\",\"contents\":[{\"text\":\"Click to copy the username\",\"color\":\"blue\"}]}},\" \",{\"text\":\"[Party]\",\"color\":\"gold\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/p invite $username\"},\"hoverEvent\":{\"action\":\"show_text\",\"contents\":[\"Click to party player\"]}},\" \",{\"text\":\"[Invite]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/invite\"},\"hoverEvent\":{\"action\":\"show_text\",\"contents\":[\"Click to invite them to visit your private island/garden\"]}},\" \",{\"text\":\"[Visit]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/visit $username\"},\"hoverEvent\":{\"action\":\"show_text\",\"contents\":[\"Click to open the visit menu for that user\"]}},\" \",{\"text\":\"[creport]\",\"color\":\"dark_red\",\"clickEvent\":{\"action\":\"suggest_command\",\"value\":\"/creport $username\"},\"hoverEvent\":{\"action\":\"show_text\",\"contents\":[\"Click to report the player for chat (public)\"]}},\" \",{\"text\":\"[Ignore add]\",\"color\":\"red\",\"clickEvent\":{\"action\":\"suggest_command\",\"value\":\"/ignore add $username\"},\"hoverEvent\":{\"action\":\"show_text\",\"contents\":[\"Click to ignore add the user\"]}},\" \",{\"text\":\"[Copy content]\",\"color\":\"gray\",\"clickEvent\":{\"action\":\"copy_to_clipboard\",\"value\":\"$messagecontent\"},\"hoverEvent\":{\"action\":\"show_text\",\"contents\":[\"Click to copy the message content\"]}},\" \",{\"text\":\"[Copy message]\",\"color\":\"blue\",\"clickEvent\":{\"action\":\"copy_to_clipboard\",\"value\":\"$message\"},\"hoverEvent\":{\"action\":\"show_text\",\"contents\":[\"Click to copy the exact message\"]}},\" \",{\"text\":\"[Msg]\",\"color\":\"dark_purple\",\"clickEvent\":{\"action\":\"suggest_command\",\"value\":\"/msg $username\"},\"hoverEvent\":{\"action\":\"show_text\",\"contents\":[\"Click to msg the user\"]}},\" \",{\"text\":\"[Sky shiiyu]\",\"color\":\"aqua\",\"clickEvent\":{\"action\":\"open_url\",\"value\":\"https://sky.shiiyu.moe/stats/$username\"},\"hoverEvent\":{\"action\":\"show_text\",\"contents\":[\"Click to open the users sky shiiyu page.\"]}},\"\\n\"]";
- //{"jformat":8,"jobject":[{"bold":false,"italic":false,"underlined":true,"strikethrough":false,"obfuscated":false,"font":null,"color":"blue","insertion":"","click_event_type":"copy_to_clipboard","click_event_value":"$username","hover_event_type":"show_text","hover_event_value":"","hover_event_children":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"blue","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":"Click to copy the username"}],"text":"$username"},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":" "},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"gold","insertion":"","click_event_type":"run_command","click_event_value":"/p invite $username","hover_event_type":"show_text","hover_event_value":"","hover_event_children":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":"Click to party player"}],"text":"[Party]"},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":" "},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"green","insertion":"","click_event_type":"run_command","click_event_value":"/invite","hover_event_type":"show_text","hover_event_value":"","hover_event_children":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":"Click to invite them to visit your private island/garden"}],"text":"[Invite]"},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":" "},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"green","insertion":"","click_event_type":"run_command","click_event_value":"/visit $username","hover_event_type":"show_text","hover_event_value":"","hover_event_children":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":"Click to open the visit menu for that user"}],"text":"[Visit]"},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":" "},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"dark_red","insertion":"","click_event_type":"suggest_command","click_event_value":"/creport $username","hover_event_type":"show_text","hover_event_value":"","hover_event_children":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":"Click to report the player for chat (public)"}],"text":"[creport]"},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":" "},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"red","insertion":"","click_event_type":"suggest_command","click_event_value":"/ignore add $username","hover_event_type":"show_text","hover_event_value":"","hover_event_children":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":"Click to ignore add the user"}],"text":"[Ignore add]"},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":" "},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"gray","insertion":"","click_event_type":"copy_to_clipboard","click_event_value":"$messagecontent","hover_event_type":"show_text","hover_event_value":"","hover_event_children":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":"Click to copy the message content"}],"text":"[Copy content]"},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":" "},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"blue","insertion":"","click_event_type":"copy_to_clipboard","click_event_value":"$message","hover_event_type":"show_text","hover_event_value":"","hover_event_children":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":"Click to copy the exact message"}],"text":"[Copy message]"},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":" "},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"dark_purple","insertion":"","click_event_type":"suggest_command","click_event_value":"/msg $username","hover_event_type":"show_text","hover_event_value":"","hover_event_children":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":"Click to msg the user"}],"text":"[Msg]"},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":" "},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"aqua","insertion":"","click_event_type":"open_url","click_event_value":"https://sky.shiiyu.moe/stats/$username","hover_event_type":"show_text","hover_event_value":"","hover_event_children":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":"Click to open the users sky shiiyu page."}],"text":"[Sky shiiyu]"}],"command":"%s","jtemplate":"tellraw"}
- }
- else if (parameters[0].equals("guild")) {
- tellrawjson = "[\"\",{\"text\":\"\n\n$username\",\"underlined\":true,\"color\":\"blue\",\"clickEvent\":{\"action\":\"copy_to_clipboard\",\"value\":\"$username\"},\"hoverEvent\":{\"action\":\"show_text\",\"contents\":[{\"text\":\"Click to copy the username\",\"color\":\"blue\"}]}},\" \",{\"text\":\"[Party]\",\"color\":\"gold\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/p invite $username\"},\"hoverEvent\":{\"action\":\"show_text\",\"contents\":[\"Click to party player\"]}},\" \",{\"text\":\"[SB Options]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/socialoptions sb $username $message\"},\"hoverEvent\":{\"action\":\"show_text\",\"contents\":[\"Click to open the SB options\"]}},\" \",{\"text\":\"[Member info]\",\"color\":\"dark_aqua\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/g member $username\"},\"hoverEvent\":{\"action\":\"show_text\",\"contents\":[\"Show guild info about the user.\"]}},\" \",{\"text\":\"[Copy content]\",\"color\":\"gray\",\"clickEvent\":{\"action\":\"copy_to_clipboard\",\"value\":\"$messagecontent\"},\"hoverEvent\":{\"action\":\"show_text\",\"contents\":[\"Click to copy the message content\"]}},\" \",{\"text\":\"[Copy message]\",\"color\":\"blue\",\"clickEvent\":{\"action\":\"copy_to_clipboard\",\"value\":\"$message\"},\"hoverEvent\":{\"action\":\"show_text\",\"contents\":[\"Click to copy the exact message\"]}},\" \",{\"text\":\"[Msg]\",\"color\":\"dark_purple\",\"clickEvent\":{\"action\":\"suggest_command\",\"value\":\"/msg $username\"},\"hoverEvent\":{\"action\":\"show_text\",\"contents\":[\"Click to msg the user\"]}},\" \",{\"text\":\"[Ignore add]\",\"color\":\"red\",\"clickEvent\":{\"action\":\"suggest_command\",\"value\":\"/ignore add $username\"},\"hoverEvent\":{\"action\":\"show_text\",\"contents\":[\"Click to ignore add the user\"]}},\"\\n\",{\"text\":\"G Admin: \",\"color\":\"dark_red\"},{\"text\":\"[kick]\",\"color\":\"dark_purple\",\"clickEvent\":{\"action\":\"suggest_command\",\"value\":\"/g kick $username\"},\"hoverEvent\":{\"action\":\"show_text\",\"contents\":[\"suggest the command to kick the user\"]}},\" \",{\"text\":\"[mute]\",\"color\":\"red\",\"clickEvent\":{\"action\":\"suggest_command\",\"value\":\"/g mute $username\"},\"hoverEvent\":{\"action\":\"show_text\",\"contents\":[\"Suggest a mute command for the user.\"]}},\" \",{\"text\":\"[promote]\",\"color\":\"dark_green\",\"clickEvent\":{\"action\":\"suggest_command\",\"value\":\"/g promote $username\"},\"hoverEvent\":{\"action\":\"show_text\",\"contents\":[\"Click to promote the user\"]}},\" \",{\"text\":\"[demote]\",\"color\":\"red\",\"clickEvent\":{\"action\":\"suggest_command\",\"value\":\"/g demote $username\"},\"hoverEvent\":{\"action\":\"show_text\",\"contents\":[\"Click to demote the user\"]}}]";
- //{"jformat":8,"jobject":[{"bold":false,"italic":false,"underlined":true,"strikethrough":false,"obfuscated":false,"font":null,"color":"blue","insertion":"","click_event_type":"copy_to_clipboard","click_event_value":"$username","hover_event_type":"show_text","hover_event_value":"","hover_event_children":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"blue","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":"Click to copy the username"}],"text":"$username"},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":" "},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"gold","insertion":"","click_event_type":"run_command","click_event_value":"/p invite $username","hover_event_type":"show_text","hover_event_value":"","hover_event_children":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":"Click to party player"}],"text":"[Party]"},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":" "},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"green","insertion":"","click_event_type":"run_command","click_event_value":"/socialoptions sb $username $message","hover_event_type":"show_text","hover_event_value":"","hover_event_children":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":"Click to open the SB options"}],"text":"[SB Options]"},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":" "},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"dark_aqua","insertion":"","click_event_type":"run_command","click_event_value":"/g member $username","hover_event_type":"show_text","hover_event_value":"","hover_event_children":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":"Show guild info about the user."}],"text":"[Member info]"},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":" "},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"gray","insertion":"","click_event_type":"copy_to_clipboard","click_event_value":"$messagecontent","hover_event_type":"show_text","hover_event_value":"","hover_event_children":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":"Click to copy the message content"}],"text":"[Copy content]"},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":" "},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"blue","insertion":"","click_event_type":"copy_to_clipboard","click_event_value":"$message","hover_event_type":"show_text","hover_event_value":"","hover_event_children":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":"Click to copy the exact message"}],"text":"[Copy message]"},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":" "},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"dark_purple","insertion":"","click_event_type":"suggest_command","click_event_value":"/msg $username","hover_event_type":"show_text","hover_event_value":"","hover_event_children":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":"Click to msg the user"}],"text":"[Msg]"},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":" "},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"red","insertion":"","click_event_type":"suggest_command","click_event_value":"/ignore add $username","hover_event_type":"show_text","hover_event_value":"","hover_event_children":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":"Click to ignore add the user"}],"text":"[Ignore add]"},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":"\n"},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"dark_red","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":"G Admin: "},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"dark_purple","insertion":"","click_event_type":"suggest_command","click_event_value":"/g kick $username","hover_event_type":"show_text","hover_event_value":"","hover_event_children":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":"suggest the command to kick the user"}],"text":"[kick]"},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":" "},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"red","insertion":"","click_event_type":"suggest_command","click_event_value":"/g mute $username","hover_event_type":"show_text","hover_event_value":"","hover_event_children":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":"Suggest a mute command for the user."}],"text":"[mute]"},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":" "},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"dark_green","insertion":"","click_event_type":"suggest_command","click_event_value":"/g promote $username","hover_event_type":"show_text","hover_event_value":"","hover_event_children":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":"Click to promote the user"}],"text":"[promote]"},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":" "},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"red","insertion":"","click_event_type":"suggest_command","click_event_value":"/g demote $username","hover_event_type":"show_text","hover_event_value":"","hover_event_children":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":"Click to demote the user"}],"text":"[demote]"}],"command":"%s","jtemplate":"tellraw"}
- }
- else if (parameters[0].equals("party")) {
- if (config.isLeader()) {
- tellrawjson = "[\"\",{\"text\":\"\n\n$username\",\"underlined\":true,\"color\":\"blue\",\"clickEvent\":{\"action\":\"copy_to_clipboard\",\"value\":\"$username\"},\"hoverEvent\":{\"action\":\"show_text\",\"contents\":[{\"text\":\"Click to copy the username\",\"color\":\"blue\"}]}},\" \",{\"text\":\"[Party]\",\"color\":\"gold\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/p invite $username\"},\"hoverEvent\":{\"action\":\"show_text\",\"contents\":[\"Click to party player\"]}},\" \",{\"text\":\"[SB Options]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/socialoptions sb $username $message\"},\"hoverEvent\":{\"action\":\"show_text\",\"contents\":[\"Click to open the SB options\"]}},\" \",{\"text\":\"[Copy content]\",\"color\":\"gray\",\"clickEvent\":{\"action\":\"copy_to_clipboard\",\"value\":\"$messagecontent\"},\"hoverEvent\":{\"action\":\"show_text\",\"contents\":[\"Click to copy the message content\"]}},\" \",{\"text\":\"[Copy message]\",\"color\":\"blue\",\"clickEvent\":{\"action\":\"copy_to_clipboard\",\"value\":\"$message\"},\"hoverEvent\":{\"action\":\"show_text\",\"contents\":[\"Click to copy the exact message\"]}},\" \",{\"text\":\"[Msg]\",\"color\":\"dark_purple\",\"clickEvent\":{\"action\":\"suggest_command\",\"value\":\"/msg $username\"},\"hoverEvent\":{\"action\":\"show_text\",\"contents\":[\"Click to msg the user\"]}},\" \",{\"text\":\"[Ignore add]\",\"color\":\"red\",\"clickEvent\":{\"action\":\"suggest_command\",\"value\":\"/ignore add $username\"},\"hoverEvent\":{\"action\":\"show_text\",\"contents\":[\"Click to ignore add the user\"]}},\"\\n\",\"\\n\",{\"text\":\"P Leader: \",\"color\":\"dark_red\"},{\"text\":\"[kick]\",\"color\":\"dark_purple\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/p kick $username\"},\"hoverEvent\":{\"action\":\"show_text\",\"contents\":[\"suggest the command to kick the user\"]}},\" \",{\"text\":\"[transfer]\",\"color\":\"dark_red\",\"clickEvent\":{\"action\":\"suggest_command\",\"value\":\"/p transfer $username\"},\"hoverEvent\":{\"action\":\"show_text\",\"contents\":[\"Suggest a mute command for the user.\"]}},\" \",{\"text\":\"[promote]\",\"color\":\"dark_green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/p promote $username\"},\"hoverEvent\":{\"action\":\"show_text\",\"contents\":[\"Click to promote the user\"]}},\" \",{\"text\":\"[demote]\",\"color\":\"red\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/p demote $username\"},\"hoverEvent\":{\"action\":\"show_text\",\"contents\":[\"Click to demote the user\"]}}]";
- //{"jformat":8,"jobject":[{"bold":false,"italic":false,"underlined":true,"strikethrough":false,"obfuscated":false,"font":null,"color":"blue","insertion":"","click_event_type":"copy_to_clipboard","click_event_value":"$username","hover_event_type":"show_text","hover_event_value":"","hover_event_children":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"blue","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":"Click to copy the username"}],"text":"$username"},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":" "},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"gold","insertion":"","click_event_type":"run_command","click_event_value":"/p invite $username","hover_event_type":"show_text","hover_event_value":"","hover_event_children":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":"Click to party player"}],"text":"[Party]"},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":" "},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"green","insertion":"","click_event_type":"run_command","click_event_value":"/socialoptions sb $username $message","hover_event_type":"show_text","hover_event_value":"","hover_event_children":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":"Click to open the SB options"}],"text":"[SB Options]"},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":" "},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"gray","insertion":"","click_event_type":"copy_to_clipboard","click_event_value":"$messagecontent","hover_event_type":"show_text","hover_event_value":"","hover_event_children":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":"Click to copy the message content"}],"text":"[Copy content]"},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":" "},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"blue","insertion":"","click_event_type":"copy_to_clipboard","click_event_value":"$message","hover_event_type":"show_text","hover_event_value":"","hover_event_children":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":"Click to copy the exact message"}],"text":"[Copy message]"},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":" "},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"dark_purple","insertion":"","click_event_type":"suggest_command","click_event_value":"/msg $username","hover_event_type":"show_text","hover_event_value":"","hover_event_children":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":"Click to msg the user"}],"text":"[Msg]"},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":" "},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"red","insertion":"","click_event_type":"suggest_command","click_event_value":"/ignore add $username","hover_event_type":"show_text","hover_event_value":"","hover_event_children":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":"Click to ignore add the user"}],"text":"[Ignore add]"},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":"\n"},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":"\n"},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"dark_red","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":"P Leader: "},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"dark_purple","insertion":"","click_event_type":"run_command","click_event_value":"/p kick $username","hover_event_type":"show_text","hover_event_value":"","hover_event_children":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":"suggest the command to kick the user"}],"text":"[kick]"},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":" "},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"dark_red","insertion":"","click_event_type":"suggest_command","click_event_value":"/p transfer $username","hover_event_type":"show_text","hover_event_value":"","hover_event_children":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":"Suggest a mute command for the user."}],"text":"[transfer]"},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":" "},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"dark_green","insertion":"","click_event_type":"run_command","click_event_value":"/p promote $username","hover_event_type":"show_text","hover_event_value":"","hover_event_children":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":"Click to promote the user"}],"text":"[promote]"},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":" "},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"red","insertion":"","click_event_type":"run_command","click_event_value":"/p demote $username","hover_event_type":"show_text","hover_event_value":"","hover_event_children":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":"Click to demote the user"}],"text":"[demote]"}],"command":"%s","jtemplate":"tellraw"}
- }
- else {
- tellrawjson = "[\"\",{\"text\":\"\n\n$username\",\"underlined\":true,\"color\":\"blue\",\"clickEvent\":{\"action\":\"copy_to_clipboard\",\"value\":\"$username\"},\"hoverEvent\":{\"action\":\"show_text\",\"contents\":[{\"text\":\"Click to copy the username\",\"color\":\"blue\"}]}},\" \",{\"text\":\"[Party]\",\"color\":\"gold\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/p invite $username\"},\"hoverEvent\":{\"action\":\"show_text\",\"contents\":[\"Click to party player\"]}},\" \",{\"text\":\"[SB Options]\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/socialoptions sb $username $message\"},\"hoverEvent\":{\"action\":\"show_text\",\"contents\":[\"Click to open the SB options\"]}},\" \",{\"text\":\"[Copy content]\",\"color\":\"gray\",\"clickEvent\":{\"action\":\"copy_to_clipboard\",\"value\":\"$messagecontent\"},\"hoverEvent\":{\"action\":\"show_text\",\"contents\":[\"Click to copy the message content\"]}},\" \",{\"text\":\"[Copy message]\",\"color\":\"blue\",\"clickEvent\":{\"action\":\"copy_to_clipboard\",\"value\":\"$message\"},\"hoverEvent\":{\"action\":\"show_text\",\"contents\":[\"Click to copy the exact message\"]}},\" \",{\"text\":\"[Msg]\",\"color\":\"dark_purple\",\"clickEvent\":{\"action\":\"suggest_command\",\"value\":\"/msg $username\"},\"hoverEvent\":{\"action\":\"show_text\",\"contents\":[\"Click to msg the user\"]}},\" \",{\"text\":\"[Ignore add]\",\"color\":\"red\",\"clickEvent\":{\"action\":\"suggest_command\",\"value\":\"/ignore add $username\"},\"hoverEvent\":{\"action\":\"show_text\",\"contents\":[\"Click to ignore add the user\"]}}]";
- //{"jformat":8,"jobject":[{"bold":false,"italic":false,"underlined":true,"strikethrough":false,"obfuscated":false,"font":null,"color":"blue","insertion":"","click_event_type":"copy_to_clipboard","click_event_value":"$username","hover_event_type":"show_text","hover_event_value":"","hover_event_children":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"blue","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":"Click to copy the username"}],"text":"$username"},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":" "},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"gold","insertion":"","click_event_type":"run_command","click_event_value":"/p invite $username","hover_event_type":"show_text","hover_event_value":"","hover_event_children":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":"Click to party player"}],"text":"[Party]"},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":" "},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"green","insertion":"","click_event_type":"run_command","click_event_value":"/socialoptions sb $username $message","hover_event_type":"show_text","hover_event_value":"","hover_event_children":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":"Click to open the SB options"}],"text":"[SB Options]"},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":" "},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"gray","insertion":"","click_event_type":"copy_to_clipboard","click_event_value":"$messagecontent","hover_event_type":"show_text","hover_event_value":"","hover_event_children":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":"Click to copy the message content"}],"text":"[Copy content]"},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":" "},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"blue","insertion":"","click_event_type":"copy_to_clipboard","click_event_value":"$message","hover_event_type":"show_text","hover_event_value":"","hover_event_children":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":"Click to copy the exact message"}],"text":"[Copy message]"},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":" "},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"dark_purple","insertion":"","click_event_type":"suggest_command","click_event_value":"/msg $username","hover_event_type":"show_text","hover_event_value":"","hover_event_children":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":"Click to msg the user"}],"text":"[Msg]"},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":" "},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"red","insertion":"","click_event_type":"suggest_command","click_event_value":"/ignore add $username","hover_event_type":"show_text","hover_event_value":"","hover_event_children":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":"Click to ignore add the user"}],"text":"[Ignore add]"}],"command":"%s","jtemplate":"tellraw"}
- }
- //{"jformat":8,"jobject":[{"bold":false,"italic":false,"underlined":true,"strikethrough":false,"obfuscated":false,"font":null,"color":"blue","insertion":"","click_event_type":"copy_to_clipboard","click_event_value":"$username","hover_event_type":"show_text","hover_event_value":"","hover_event_children":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"blue","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":"Click to copy the username"}],"text":"$username"},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":" "},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"gold","insertion":"","click_event_type":"run_command","click_event_value":"/p invite $username","hover_event_type":"show_text","hover_event_value":"","hover_event_children":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":"Click to party player"}],"text":"[Party]"},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":" "},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"green","insertion":"","click_event_type":"run_command","click_event_value":"/socialoptions sb $username $message","hover_event_type":"show_text","hover_event_value":"","hover_event_children":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":"Click to open the SB options"}],"text":"[SB Options]"},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":" "},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"gray","insertion":"","click_event_type":"copy_to_clipboard","click_event_value":"$messagecontent","hover_event_type":"show_text","hover_event_value":"","hover_event_children":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":"Click to copy the message content"}],"text":"[Copy content]"},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":" "},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"blue","insertion":"","click_event_type":"copy_to_clipboard","click_event_value":"$message","hover_event_type":"show_text","hover_event_value":"","hover_event_children":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":"Click to copy the exact message"}],"text":"[Copy message]"},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":" "},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"dark_purple","insertion":"","click_event_type":"suggest_command","click_event_value":"/msg $username","hover_event_type":"show_text","hover_event_value":"","hover_event_children":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":"Click to msg the user"}],"text":"[Msg]"},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":" "},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"red","insertion":"","click_event_type":"suggest_command","click_event_value":"/ignore add $username","hover_event_type":"show_text","hover_event_value":"","hover_event_children":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":"Click to ignore add the user"}],"text":"[Ignore add]"},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":"\n"},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"dark_red","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":"P Leader: "},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"dark_purple","insertion":"","click_event_type":"run_command","click_event_value":"/p kick $username","hover_event_type":"show_text","hover_event_value":"","hover_event_children":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":"suggest the command to kick the user"}],"text":"[kick]"},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":" "},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"red","insertion":"","click_event_type":"suggest_command","click_event_value":"/p mute $username","hover_event_type":"show_text","hover_event_value":"","hover_event_children":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":"Suggest a mute command for the user."}],"text":"[mute]"},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":" "},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"dark_green","insertion":"","click_event_type":"run_command","click_event_value":"/p promote $username","hover_event_type":"show_text","hover_event_value":"","hover_event_children":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":"Click to promote the user"}],"text":"[promote]"},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":" "},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"red","insertion":"","click_event_type":"run_command","click_event_value":"/p demote $username","hover_event_type":"show_text","hover_event_value":"","hover_event_children":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":"Click to demote the user"}],"text":"[demote]"}],"command":"%s","jtemplate":"tellraw"}
- }
- tellrawjson = tellrawjson.replace("$username", parameters[1]);
- int doublepointIndex = parameters[2].indexOf(":");
- if (doublepointIndex != -1) {
- tellrawjson = tellrawjson.replace("$messagecontent", parameters[2].substring(doublepointIndex + 1).trim());
- }
- tellrawjson = tellrawjson.replace("$message", parameters[2]);
- }
- if (tellrawjson.isEmpty())
- Chat.sendCommand("/socialoptions " + String.join(" ", parameters));
- else {
- Chat.sendPrivateMessageToSelfText(Chat.createClientSideTellraw(tellrawjson));
- }
- return 1;
- })));
- });//sbsocialoptions
- event.register((dispatcher, registryAccess) -> {
- miningEvent(dispatcher, "goblinraid", MiningEvents.GOBLIN_RAID);
- });/*goblinraid*/
- event.register((dispatcher, registryAccess) -> {
- miningEvent(dispatcher, "2xpowder", MiningEvents.DOUBLE_POWDER);
- });/*2xpowder*/
- event.register((dispatcher, registryAccess) -> {
- miningEvent(dispatcher, "bettertogether", MiningEvents.BETTER_TOGETHER);
- });/*b2g*/
- event.register((dispatcher, registryAccess) -> {
- miningEvent(dispatcher, "raffle", MiningEvents.RAFFLE);
- });/*raffle*/
- event.register((dispatcher, registryAccess) -> {
- miningEvent(dispatcher, "gonewiththewind", MiningEvents.GONE_WITH_THE_WIND);
- });/*gonewiththewind*/
- event.register((dispatcher, registryAccess) -> {
- miningEvent(dispatcher, "mithrilgourmand", MiningEvents.MITHRIL_GOURMAND);
- });/*gonewiththewind*/
- event.register((dispatcher, registryAccess) -> {
- dispatcher.register(ClientCommandManager.literal("chchest")
- .then(ClientCommandManager.argument("Item", StringArgumentType.string())
- .suggests((context, builder) -> {
- String[] items = new String[]{"PrehistoricEgg", "Pickonimbus2000", "ElectronTransmitter", "FTX3070", "RobotronReflector", "ControlSwitch", "SyntheticHeart", "SuperliteMotor", "BlueGoblinEgg", "YellowGoblinEgg", "FlawlessAmberGemstone", "FlawlessJadeGemstone", "FlawlessSapphireGemstone", "FlawlessRubyGemstone", "FlawlessAmethystGemstone", "JungleHeart", "FlawlessTopazGemstone", "FlawlessJasperGemstone"};
- String input = builder.getRemaining().toLowerCase();
- int lastSemicolonIndex = input.lastIndexOf(";");
- List<String> suggestions = new ArrayList<>();
- if (lastSemicolonIndex >= 0) {
- String inputBeforeSemicolon = input.substring(0, lastSemicolonIndex + 1); // Include the semicolon
-
- for (String item : items) {
- suggestions.add(inputBeforeSemicolon + item);
- }
- }
- return CommandSource.suggestMatching(suggestions, builder);
- })
- .then(ClientCommandManager.argument("X", IntegerArgumentType.integer())
- .then(ClientCommandManager.argument("Y", IntegerArgumentType.integer())
- .then(ClientCommandManager.argument("Z", IntegerArgumentType.integer())
- .then(ClientCommandManager.argument("ContactWay", StringArgumentType.string())
- .suggests(((context, builder) -> {
- return CommandSource.suggestMatching(new String[]{"\"/msg " + getConfig().getUsername() + " bb:party me\"", "\"/p join " + config.getUsername() + "\""}, builder);
- }))
- .executes((context) -> {
- String item = StringArgumentType.getString(context, "Item");
- int x = IntegerArgumentType.getInteger(context, "X");
- int y = IntegerArgumentType.getInteger(context, "Y");
- int z = IntegerArgumentType.getInteger(context, "Z");
- String contactWay = StringArgumentType.getString(context, "ContactWay");
-
- connection.sendPacket(new ChChestPacket("", ChChestItems.getItem(item.split(";")), x + " " + y + " " + z, contactWay, ""));
- return 1;
- }
- )
- )
- )
- )
- )
- )
- );
- });/*chchest*/
- event.register((dispatcher, registryAccess) -> {
- dispatcher.register(
- ClientCommandManager.literal("bc")
- .then(ClientCommandManager.argument("Message to Bingo Chat", StringArgumentType.greedyString())
- .executes((context) -> {
- String message = StringArgumentType.getString(context, "Message to Bingo Chat");
- sendPacket(new BingoChatMessagePacket("", "", message, 0));
- return 1;
- })
- )
- );
- });/*BincoChatShort*/
- event.register((dispatcher, registryAccess) -> {
- dispatcher.register(
- ClientCommandManager.literal("bingochat")
- .then(ClientCommandManager.argument("Message to Bingo Chat", StringArgumentType.greedyString())
- .executes((context) -> {
- String message = StringArgumentType.getString(context, "Message to Bingo Chat");
- sendPacket(new BingoChatMessagePacket("", "", message, 0));
- return 1;
- })
- )
- );
- });/*BingoChatLong*/
- if (getConfig().bbsentialsRoles != null) {
- if (getConfig().hasBBRoles("mod")) {
- event.register((dispatcher, registryAccess) -> {
- dispatcher.register(
- ClientCommandManager.literal("bannounce")
- .then(ClientCommandManager.argument("message", StringArgumentType.greedyString())
- .executes((context) -> {
- String message = StringArgumentType.getString(context, "message");
- sendCommand("?announce " + message);
- return 1;
- })
- )
- );
- });/*bAnnounce*/
- event.register((dispatcher, registryAccess) -> {
- dispatcher.register(ClientCommandManager.literal("bmute")
- .then(ClientCommandManager.argument("userId/mcusername", StringArgumentType.string())
- .then(ClientCommandManager.argument("[Duration(d/h/m/s) | 0 forever]", StringArgumentType.string())
- .then(ClientCommandManager.argument("reason", StringArgumentType.greedyString())
- .executes((context) -> {
- String identification = StringArgumentType.getString(context, "userId/mcusername");
- String duration = StringArgumentType.getString(context, "[Duration(d/h/m/s) | 0 forever]");
- String reason = StringArgumentType.getString(context, "reason");
- int userId = -1;
- String mcusername = "";
- if (identification.replaceAll("[\\d]", "").trim().isEmpty()) {
- userId = Integer.parseInt(identification);
- }
- else {
- mcusername = identification;
- }
- sendPacket(new PunishUserPacket(PunishUserPacket.PUNISHMENT_TYPE_MUTE, userId, mcusername, duration, reason));
- return 1;
- })
- )
- )
- )
- );
- });/*bmute*/
- event.register((dispatcher, registryAccess) -> {
- dispatcher.register(ClientCommandManager.literal("bban")
- .then(ClientCommandManager.argument("userId/mcusername", StringArgumentType.string())
- .then(ClientCommandManager.argument("[Duration(d/h/m/s) | 0 forever]", StringArgumentType.string())
- .then(ClientCommandManager.argument("reason", StringArgumentType.greedyString())
- .executes((context) -> {
- String identification = StringArgumentType.getString(context, "userId/mcusername");
- String duration = StringArgumentType.getString(context, "[Duration(d/h/m/s) | 0 forever]");
- String reason = StringArgumentType.getString(context, "reason");
- int userId = -1;
- String mcusername = "";
- if (identification.replaceAll("[\\d]", "").trim().isEmpty()) {
- userId = Integer.parseInt(identification);
- }
- else {
- mcusername = identification;
- }
- sendPacket(new PunishUserPacket(PunishUserPacket.PUNISHMENT_TYPE_BAN, userId, mcusername, duration, reason));
- return 1;
- })
- )
- )
- )
- );
- });/*ban*/
- event.register((dispatcher, registryAccess) -> {
- dispatcher.register(ClientCommandManager.literal("bgetinfo")
- .then(ClientCommandManager.argument("userId/mcusername", StringArgumentType.string())
- .executes((context) -> {
- String identification = StringArgumentType.getString(context, "userId/mcusername");
- sendPacket(new InternalCommandPacket(InternalCommandPacket.GET_USER_INFO, new String[]{identification}));
- return 1;
- })
- )
- );
- });/*getInfo*/
- }
- if (getConfig().hasBBRoles("splasher")) {
- event.register((dispatcher, registryAccess) -> {
- dispatcher.register(
- ClientCommandManager.literal("splashAnnounce")
- .then(ClientCommandManager.argument("Hub", IntegerArgumentType.integer(1, 28))
- .then(ClientCommandManager.argument("location", StringArgumentType.string())
- .suggests((context, builder) -> {
- return CommandSource.suggestMatching(new String[]{"kat", "bea", "guild-house"}, builder);
- })
- .then(ClientCommandManager.argument("lasswaste", StringArgumentType.string())
- .suggests((context, builder) -> {
- return CommandSource.suggestMatching(new String[]{"true", "false"}, builder);
- })
- .then(ClientCommandManager.argument("extramessage", StringArgumentType.greedyString())
- .executes((context) -> {
- int hub = IntegerArgumentType.getInteger(context, "Hub");
- String extramessage = StringArgumentType.getString(context, "extramessage");
- String location = StringArgumentType.getString(context, "location");
- boolean lessWaste = Boolean.parseBoolean(StringArgumentType.getString(context, "lasswaste"));
- splashAnnounce(hub, location, extramessage, lessWaste);
- return 1;
- })
- )
- .executes((context) -> {
- int hub = IntegerArgumentType.getInteger(context, "Hub");
- String location = StringArgumentType.getString(context, "location");
- boolean lessWaste = Boolean.parseBoolean(StringArgumentType.getString(context, "lasswaste"));
- splashAnnounce(hub, location, "", lessWaste);
- return 1;
- })
- ))
- .executes((context) -> {
- int hub = IntegerArgumentType.getInteger(context, "Hub");
- String location = "bea";
- splashAnnounce(hub, location, "", true);
- return 1;
- })
-
- )
- );
- });/*SplashAnnounce*/
- event.register((dispatcher, registryAccess) -> {
- dispatcher.register(
- ClientCommandManager.literal("requestpottimes")
- .executes((context) -> {
- sendPacket(new InternalCommandPacket(InternalCommandPacket.REQUEST_POT_DURATION, new String[0]));
- return 1;
- })
- );
- });/*requestpottimes*/
- }
- if (getConfig().hasBBRoles("admin")) {
- event.register((dispatcher, registryAccess) -> {
- dispatcher.register(
- ClientCommandManager.literal("bshutdown")
- .then(ClientCommandManager.argument("Reason", StringArgumentType.greedyString())
- .suggests((context, builder) -> {
- return CommandSource.suggestMatching(new String[]{"Emergency Shutdown", "System Shutdown", "Other"}, builder);
- })
- .executes((context) -> {
- String reason = StringArgumentType.getString(context, "Reason");
- sendPacket(new InternalCommandPacket(InternalCommandPacket.SHUTDOWN_SERVER, new String[]{reason}));
- return 1;
- })
- )
- );
- });/*BBShutdown*/
- event.register((dispatcher, registryAccess) -> {
- dispatcher.register(
- ClientCommandManager.literal("bsetmotd")
- .then(ClientCommandManager.argument("Message", StringArgumentType.greedyString())
- .suggests((context, builder) -> {
- return CommandSource.suggestMatching(new String[]{""}, builder);
- })
- .executes((context) -> {
- String message = StringArgumentType.getString(context, "Message").trim();
- sendPacket(new InternalCommandPacket(InternalCommandPacket.SET_MOTD, new String[]{message}));
- return 1;
- })
- )
- );
- });/*BBServerMotd*/
- }
- else {
- }
- }
- }
-
- private static void simpleCommand(CommandDispatcher<FabricClientCommandSource> dispatcher, String commandName, String[] parameters) {
- dispatcher.register(
- ClientCommandManager.literal(commandName)
- .executes((context) -> {
- BBsentials.connection.sendPacket(new InternalCommandPacket(commandName, parameters));
- return 1;
- })
- );
- }
-
- private static void miningEvent(CommandDispatcher<FabricClientCommandSource> dispatcher, String commandName, MiningEvents event) {
- dispatcher.register(
- ClientCommandManager.literal(commandName)
- .executes((context) -> {
- try {
- BBsentials.connection.sendPacket(new MiningEventPacket(event,
- config.getUsername(), Objects.requireNonNull(BBUtils.getCurrentIsland())));
- } catch (Exception e) {
- Chat.sendPrivateMessageToSelfError(e.getMessage());
- }
- return 1;
- })
- );
- }
-
- public void splashAnnounce(int hubNumber, String locationInHub, String extramessage, boolean lessWaste) {
- sendPacket(new SplashNotifyPacket(0, hubNumber, config.getUsername(), locationInHub, BBUtils.getCurrentIsland(), extramessage, lessWaste));
- }
-
-
- public void sendCommand(String message) {
- BBsentials.connection.sendCommand(message);
- }
-
- public <E extends AbstractPacket> void sendPacket(E packet) {
- BBsentials.connection.sendPacket(packet);
- }
-} \ No newline at end of file
diff --git a/src/main/java/de/hype/bbsentials/client/Config.java b/src/main/java/de/hype/bbsentials/client/Config.java
deleted file mode 100644
index 4573b5f..0000000
--- a/src/main/java/de/hype/bbsentials/client/Config.java
+++ /dev/null
@@ -1,205 +0,0 @@
-package de.hype.bbsentials.client;
-
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
-import de.hype.bbsentials.chat.Sender;
-import net.fabricmc.loader.api.FabricLoader;
-import net.minecraft.client.MinecraftClient;
-
-import java.io.*;
-import java.time.LocalDate;
-import java.util.ArrayList;
-import java.util.List;
-
-public class Config implements Serializable {
- //DO NOT Change any of the following unless you know what you are doing!
- public int apiVersion = 1;
- public boolean allowServerPartyInvite = true;
- boolean devMode = false;
- boolean detailedDevMode = false;
- //You can change again
-
- // set automatically
- private transient boolean isLeader;
- public transient String alreadyReported = "";
- public String[] bbsentialsRoles = {""};
- public static List<String> partyMembers = new ArrayList<>();
- public transient ToDisplayConfig toDisplayConfig = ToDisplayConfig.loadFromFile();
- public transient final Sender sender = new Sender();
- public transient boolean highlightitem = false;
- public transient String lastChatPromptAnswer = null;
- private transient String username;
-
- // Set via load / default you may change these
- public boolean overrideBingoTime = false;
- public boolean connectToBeta = false;
-
- public String bbServerURL = "localhost";
- String apiKey = "";
- public boolean showBingoChat = true;
- public boolean doAllChatCustomMenu=true;
- public boolean doPartyChatCustomMenu=true;
- public boolean doGuildChatCustomMenu=true;
-
- public boolean allowBBinviteMe = true;
- public boolean doDesktopNotifications = false;
- public boolean showSplashStatusUpdates = true;
- public boolean doGammaOverride = true;
- public boolean acceptReparty;
- public boolean autoSplashStatusUpdates;
- public String nickname;
- public String notifForMessagesType;
-
- // Set default attribute values
- private void setDefaults() {
- username = MinecraftClient.getInstance().player.getName().getString();
- acceptReparty = true;
- if (username.equals("Hype_the_Time")) {
- nickname = "Hype";
- notifForMessagesType = "nick";
- doDesktopNotifications=true;
- } //Gimmic for Developer due too things which dont make it into releases (bugs)
- else {
- nickname = "";
- notifForMessagesType = "none";
- }
- }
-
- // Gson object for serialization
- private final transient Gson GSON = new GsonBuilder().setPrettyPrinting().create();
- // File object for storing the config
- private final transient File CONFIG_FILE = new File(FabricLoader.getInstance().getConfigDir().toFile(), "BBsential_settings.json");
-
- // Constructor
- public Config() {
- setDefaults();
- }
-
- // Load the config from file
- public static Config load() {
- Config settings;
- File CONFIG_FILE = new File(FabricLoader.getInstance().getConfigDir().toFile(), "BBsential_settings.json");
- Gson GSON = new GsonBuilder().setPrettyPrinting().create();
- if (CONFIG_FILE.exists()) {
- try (FileReader reader = new FileReader(CONFIG_FILE)) {
- settings = GSON.fromJson(reader, Config.class);
- } catch (IOException e) {
- e.printStackTrace();
- settings = new Config(); // Use default values if loading fails
- settings.save();
- } catch (IllegalStateException e) {
- System.out.println("Error loading config. Resetting it.");
- settings = new Config();
- settings.save();
- }
- }
- else {
- settings = new Config(); // Use default values if the file doesn't exist
- settings.username = MinecraftClient.getInstance().player.getName().getString();
- }
- if (!settings.hasBBRoles("dev")) {
- settings.detailedDevMode = false;
- settings.devMode = false;
- }
- settings.save();
- return settings;
- }
-
- // Save the config to file
- public void save() {
- try (FileWriter writer = new FileWriter(CONFIG_FILE)) {
- GSON.toJson(this, writer);
- } catch (IOException e) {
- e.printStackTrace();
- }
- toDisplayConfig.saveToFile();
- }
-
- // Getter methods for various config attributes
- public String getUsername() {
- return username;
- }
-
- public boolean isLeader() {
- return isLeader;
- }
-
- public void setIsLeader(boolean value) {
- isLeader = value;
- }
-
- public String getNickname() {
- return nickname;
- }
-
- public String getNotifForParty() {
- return notifForMessagesType;
- }
-
- public boolean isDevModeEnabled() {
- return devMode;
- }
-
- public boolean isDetailedDevModeEnabled() {
- return detailedDevMode;
- }
-
- public String[] getPlayersInParty() {
- return partyMembers.toArray(new String[0]);
- }
-
- public void addReported(String playerName) {
- alreadyReported = alreadyReported + " , " + playerName;
- }
-
- public String getApiKey() {
- return apiKey;
- }
-
- public String getBBServerURL() {
- return bbServerURL;
- }
-
-
- public static boolean isBingoTime() {
- LocalDate currentDate = LocalDate.now();
- LocalDate lastDayOfMonth = currentDate.withDayOfMonth(currentDate.lengthOfMonth());
- LocalDate firstDayOfMonth = currentDate.withDayOfMonth(1);
- Boolean isBefore = currentDate.isAfter(lastDayOfMonth.minusDays(4));
- Boolean isInRange = currentDate.isBefore(firstDayOfMonth.plusDays(15));
- return isBefore || isInRange;
- }
-
- public boolean overrideBingoTime() {
- return overrideBingoTime;
- }
-
- public String getLastChatPromptAnswer() {
- return lastChatPromptAnswer;
- }
-
- public boolean allowBBinviteMe() {
- return allowBBinviteMe;
- }
-
- public void setLastChatPromptAnswer(String lastChatPromptAnswer) {
- this.lastChatPromptAnswer = lastChatPromptAnswer;
- }
-
- public boolean hasBBRoles(String roleName) {
- for (String role : bbsentialsRoles) {
- if (role.equalsIgnoreCase(roleName)) {
- return true;
- }
- }
- return false;
- }
-
- public int getApiVersion() {
- return apiVersion;
- }
-
- public String getMCUUID() {
- return MinecraftClient.getInstance().player.getUuid().toString().replace("-", "");
- }
-}
diff --git a/src/main/java/de/hype/bbsentials/client/CustomGson.java b/src/main/java/de/hype/bbsentials/client/CustomGson.java
deleted file mode 100644
index e9a41da..0000000
--- a/src/main/java/de/hype/bbsentials/client/CustomGson.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package de.hype.bbsentials.client;
-
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
-
-public class CustomGson {
- public static Gson create() {
- return new GsonBuilder()
-// .registerTypeHierarchyAdapter(BBDisplayNameProvider.class, new BBDisplayNameProviderSerializer())
- .create();
-
- }
-
-// private static class BBDisplayNameProviderSerializer implements JsonSerializer<BBDisplayNameProvider>, JsonDeserializer<BBDisplayNameProvider> {
-// @Override
-// public JsonElement serialize(BBDisplayNameProvider src, Type typeOfSrc, JsonSerializationContext context) {
-// return new JsonPrimitive(src.serialize()); // Serialize using the provided method
-// }
-//
-// @Override
-// public BBDisplayNameProvider deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
-// String serializedValue = json.getAsString();
-//
-// // Deserialize using the provided method (you need to implement this)
-// return BBDisplayNameProvider.deserialize(serializedValue);
-// }
-// }
-}
diff --git a/src/main/java/de/hype/bbsentials/client/DebugThread.java b/src/main/java/de/hype/bbsentials/client/DebugThread.java
deleted file mode 100644
index 3c853c2..0000000
--- a/src/main/java/de/hype/bbsentials/client/DebugThread.java
+++ /dev/null
@@ -1,52 +0,0 @@
-package de.hype.bbsentials.client;
-
-import net.minecraft.client.MinecraftClient;
-import net.minecraft.client.network.PlayerListEntry;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class DebugThread implements Runnable {
-
- @Override
- public void run() {
- loop();
- //place a breakpoint for only this thread here.
- }
-
- public void loop() {
-
- }
-
- public static List<String> test() {
- List<PlayerListEntry> tabList = MinecraftClient.getInstance().player.networkHandler.getPlayerList().stream().toList();
- List<PlayerListEntry> goodTabList = MinecraftClient.getInstance().player.networkHandler.getPlayerList().stream().toList();
- for (PlayerListEntry playerListEntry : tabList) {
- try {
- if (!playerListEntry.getProfile().getName().startsWith("!")) {
- goodTabList.add(playerListEntry);
- }
- } catch (Exception ignored) {
-
- }
- }
- List<String> stringList = new ArrayList<>();
- for (PlayerListEntry playerListEntry : goodTabList) {
- try {
- String string = playerListEntry.getDisplayName().getString();
- String string2 = (string.replaceAll("\\[\\d+\\]", ""));
- if (!string.isEmpty()) {
- if (!string.equals(string2)) {
- stringList.add(string2);
- }
- }
- } catch (Exception ignored) {
- }
- }
- return stringList;
- }
-
- public static List<String> playersOnTabList() {
- return test().stream().map((string) -> string.replaceAll("[^\\p{L}\\p{N}]+", "")).toList();
- }
-}
diff --git a/src/main/java/de/hype/bbsentials/client/ModMenueScreen.java b/src/main/java/de/hype/bbsentials/client/ModMenueScreen.java
deleted file mode 100644
index 30bc74a..0000000
--- a/src/main/java/de/hype/bbsentials/client/ModMenueScreen.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package de.hype.bbsentials.client;
-
-import com.terraformersmc.modmenu.api.ConfigScreenFactory;
-import com.terraformersmc.modmenu.api.ModMenuApi;
-import net.fabricmc.loader.api.FabricLoader;
-import net.minecraft.client.MinecraftClient;
-import net.minecraft.client.gui.screen.NoticeScreen;
-import net.minecraft.text.Text;
-
-public class ModMenueScreen implements ModMenuApi {
- @Override
- public ConfigScreenFactory<?> getModConfigScreenFactory() {
- if (!FabricLoader.getInstance().isModLoaded("cloth-config2")) {
- return parent -> new NoticeScreen(() -> MinecraftClient.getInstance().setScreen(parent), Text.of("BBsentials"), Text.of("BBsentials requires Cloth Config to be able to show the config."));
- }
- return BBsentialsConfigScreemFactory::create;
- }
-}
diff --git a/src/main/java/de/hype/bbsentials/client/SplashManager.java b/src/main/java/de/hype/bbsentials/client/SplashManager.java
deleted file mode 100644
index aafec8e..0000000
--- a/src/main/java/de/hype/bbsentials/client/SplashManager.java
+++ /dev/null
@@ -1,58 +0,0 @@
-package de.hype.bbsentials.client;
-
-import de.hype.bbsentials.chat.Chat;
-import de.hype.bbsentials.constants.enviromentShared.Islands;
-import de.hype.bbsentials.packets.packets.SplashNotifyPacket;
-import de.hype.bbsentials.packets.packets.SplashUpdatePacket;
-
-import java.util.HashMap;
-import java.util.Map;
-
-public class SplashManager {
- public static Map<Integer, DisplaySplash> splashPool = new HashMap<>();
-
- public SplashManager() {
-
- }
-
- public static void addSplash(SplashNotifyPacket packet) {
- splashPool.put(packet.splashId, new DisplaySplash(packet));
- }
-
- public static void updateSplash(SplashUpdatePacket packet) {
- DisplaySplash splash = splashPool.get(packet.splashId);
- if (splash != null) {
- if (splash.alreadyDisplayed) {
- if (BBsentials.config.showSplashStatusUpdates) {
- Chat.sendPrivateMessageToSelfImportantInfo(splash.hubType.getDisplayName() + " #" + splash.hub + " is " + packet.status);
- }
- }
- else {
- splashPool.remove(splash.splashId);
- }
- }
- }
-
- public static void display(int splashId) {
- SplashNotifyPacket splash = splashPool.get(splashId);
- if (splash == null) return;
- String where;
- if (splash.hubType.equals(Islands.DUNGEON_HUB)) {
- where = "§5DUNGEON HUB§6";
- }
- else {
- where = "Hub";
- }
- BBsentials.connection.splashHighlightItem("HUB #" + splash.hub, 20);
- Chat.sendPrivateMessageToSelfImportantInfo(splash.splasherUsername + " is Splashing in " + where + " #" + splash.hub + " at " + splash.location + ":" + splash.extraMessage);
- }
-
- private static class DisplaySplash extends SplashNotifyPacket {
- public boolean alreadyDisplayed;
-
- public DisplaySplash(SplashNotifyPacket packet) {
- super(packet.splashId, packet.hub, packet.splasherUsername, packet.location, packet.hubType, packet.extraMessage, packet.lessWaste);
- alreadyDisplayed = false;
- }
- }
-}
diff --git a/src/main/java/de/hype/bbsentials/client/SplashStatusUpdateListener.java b/src/main/java/de/hype/bbsentials/client/SplashStatusUpdateListener.java
deleted file mode 100644
index 95caab8..0000000
--- a/src/main/java/de/hype/bbsentials/client/SplashStatusUpdateListener.java
+++ /dev/null
@@ -1,65 +0,0 @@
-package de.hype.bbsentials.client;
-
-import de.hype.bbsentials.communication.BBsentialConnection;
-import de.hype.bbsentials.packets.packets.SplashNotifyPacket;
-import de.hype.bbsentials.packets.packets.SplashUpdatePacket;
-
-import java.util.concurrent.TimeUnit;
-
-import static de.hype.bbsentials.client.BBsentials.executionService;
-import static de.hype.bbsentials.client.BBsentials.splashLobby;
-
-public class SplashStatusUpdateListener implements Runnable {
- BBsentialConnection connection;
- SplashNotifyPacket packet;
- private String status = SplashUpdatePacket.STATUS_WAITING;
- public String newStatus = SplashUpdatePacket.STATUS_WAITING;
- public boolean splashed = false;
- public boolean full = false;
-
- public SplashStatusUpdateListener(BBsentialConnection connection, SplashNotifyPacket packet) {
- this.connection = connection;
- this.packet = packet;
- }
-
- @Override
- public void run() {
- BBsentials.splashLobby = true;
- int maxPlayerCount = BBUtils.getMaximumPlayerCount() - 5;
- while (BBsentials.splashLobby) {
- if (!full&&(BBUtils.getPlayerCount() >= maxPlayerCount)) {
- newStatus = SplashUpdatePacket.STATUS_FULL;
- full=true;
- }
- if (!status.equals(newStatus)) {
- status = newStatus;
- connection.sendPacket(new SplashUpdatePacket(packet.splashId, status));
- }
- try {
- Thread.sleep(250);
- } catch (InterruptedException ignored) {
- }
- }
- if (splashed) {
- newStatus = SplashUpdatePacket.STATUS_DONE;
- }
- else {
- newStatus = SplashUpdatePacket.STATUS_CANCELED;
- }
- if (!status.equals(newStatus)) {
- status = newStatus;
- connection.sendPacket(new SplashUpdatePacket(packet.splashId, status));
- }
- }
-
- public void setStatus(String newStatus) {
- this.newStatus = newStatus;
- if (newStatus.equals(SplashUpdatePacket.STATUS_SPLASHING)) {
- splashed=true;
- executionService.schedule(() -> {
- setStatus(SplashUpdatePacket.STATUS_DONE);
- splashLobby = false;
- }, 1, TimeUnit.MINUTES);
- }
- }
-}
diff --git a/src/main/java/de/hype/bbsentials/client/ToDisplayConfig.java b/src/main/java/de/hype/bbsentials/client/ToDisplayConfig.java
deleted file mode 100644
index 4a048ab..0000000
--- a/src/main/java/de/hype/bbsentials/client/ToDisplayConfig.java
+++ /dev/null
@@ -1,96 +0,0 @@
-package de.hype.bbsentials.client;
-
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
-import net.fabricmc.loader.api.FabricLoader;
-
-import java.io.File;
-import java.io.FileReader;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.lang.reflect.Field;
-
-public class ToDisplayConfig {
- public boolean disableAll = false;
- public boolean allChChestItem = true;
- public boolean allRoboPart = false;
- public boolean customChChestItem = false;
-
- public boolean prehistoricEgg = false;
- public boolean pickonimbus2000 = false;
- public boolean controlSwitch = false;
- public boolean electronTransmitter = false;
- public boolean ftx3070 = false;
- public boolean robotronReflector = false;
- public boolean superliteMotor = false;
- public boolean syntheticHeart = false;
- public boolean flawlessGemstone = false;
- public boolean jungleHeart = false;
-
- //Mining Events.
- public boolean allEvents = true;
- public boolean blockChEvents = false;
-
- public String betterTogether = "none";
- public String doublePowder = "none";
- public String goneWithTheWind = "none";
- public boolean goblinRaid = false;
- public boolean mithrilGourmand = false;
- public boolean raffle = false;
-
- // Serialize the object to JSON and save to file
- public void saveToFile() {
- File configFile = new File(FabricLoader.getInstance().getConfigDirectory(), "BBsentials_display_Config.json");
- Gson gson = new GsonBuilder().setPrettyPrinting().create();
-
- try (FileWriter writer = new FileWriter(configFile)) {
- gson.toJson(this, writer);
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
-
- // Deserialize the object from JSON file
- public static ToDisplayConfig loadFromFile() {
- File configFile = new File(FabricLoader.getInstance().getConfigDirectory(), "BBsentials_display_Config.json");
- Gson gson = new Gson();
-
- try (FileReader reader = new FileReader(configFile)) {
- return gson.fromJson(reader, ToDisplayConfig.class);
- } catch (IOException e) {
- e.printStackTrace();
- }
-
- // If file doesn't exist or there's an error, return a new instance
- return new ToDisplayConfig();
- }
-
- public void setValueAndSave(String propertyName, Object newValue) {
- String lowerCasePropertyName = propertyName.toLowerCase();
-
- try {
- Field field = getClass().getDeclaredField(lowerCasePropertyName);
- field.setAccessible(true);
-
- field.set(this, newValue);
- saveToFile();
- } catch (NoSuchFieldException | IllegalAccessException e) {
- e.printStackTrace();
- }
- }
-
- // Method to get a value based on property name
- public boolean getValue(String propertyName) {
- if (disableAll) return false;
- String lowerCasePropertyName = propertyName.toLowerCase();
- try {
- Field field = getClass().getDeclaredField(lowerCasePropertyName);
- field.setAccessible(true);
- return field.getBoolean(this);
- } catch (NoSuchFieldException | IllegalAccessException e) {
- e.printStackTrace();
- }
-
- return false;
- }
-}
diff --git a/src/main/java/de/hype/bbsentials/communication/BBsentialConnection.java b/src/main/java/de/hype/bbsentials/communication/BBsentialConnection.java
deleted file mode 100644
index 49353be..0000000
--- a/src/main/java/de/hype/bbsentials/communication/BBsentialConnection.java
+++ /dev/null
@@ -1,569 +0,0 @@
-package de.hype.bbsentials.communication;
-
-import de.hype.bbsentials.chat.Chat;
-import de.hype.bbsentials.client.BBsentials;
-import de.hype.bbsentials.client.SplashManager;
-import de.hype.bbsentials.client.SplashStatusUpdateListener;
-import de.hype.bbsentials.constants.enviromentShared.*;
-import de.hype.bbsentials.packets.AbstractPacket;
-import de.hype.bbsentials.packets.PacketManager;
-import de.hype.bbsentials.packets.PacketUtils;
-import de.hype.bbsentials.packets.packets.*;
-import net.minecraft.client.MinecraftClient;
-import net.minecraft.client.sound.PositionedSoundInstance;
-import net.minecraft.entity.effect.StatusEffectInstance;
-import net.minecraft.entity.effect.StatusEffects;
-import net.minecraft.sound.SoundEvent;
-import net.minecraft.sound.SoundEvents;
-
-import javax.net.ssl.SSLContext;
-import javax.net.ssl.SSLSocketFactory;
-import javax.net.ssl.TrustManager;
-import javax.net.ssl.X509TrustManager;
-import java.io.*;
-import java.net.Socket;
-import java.net.SocketException;
-import java.security.KeyManagementException;
-import java.security.NoSuchAlgorithmException;
-import java.security.PublicKey;
-import java.security.SecureRandom;
-import java.security.cert.CertificateException;
-import java.security.cert.CertificateFactory;
-import java.security.cert.X509Certificate;
-import java.util.Arrays;
-import java.util.concurrent.LinkedBlockingQueue;
-import java.util.concurrent.TimeUnit;
-
-import static de.hype.bbsentials.client.BBsentials.config;
-import static de.hype.bbsentials.client.BBsentials.executionService;
-
-public class BBsentialConnection {
- private Socket socket;
- private BufferedReader reader;
- private PrintWriter writer;
- private LinkedBlockingQueue<String> messageQueue;
- private MessageReceivedCallback messageReceivedCallback;
- private String itemName = "Hub #0";
- private PacketManager packetManager;
-
- public BBsentialConnection() {
- packetManager = new PacketManager(this);
- }
-
- public static int getPotTime() {
- int remainingDuration = 0;
- StatusEffectInstance potTimeRequest = MinecraftClient.getInstance().player.getStatusEffect(StatusEffects.STRENGTH);
- if (potTimeRequest != null) {
- if (potTimeRequest.getAmplifier() >= 7) {
- remainingDuration = (int) (potTimeRequest.getDuration() / 20.0);
- }
- }
- return remainingDuration;
- }
-
- public static boolean isCommandSafe(String command) {
- if (command.startsWith("/p ") || command.startsWith("/party ") || command.startsWith("/boop ") || command.startsWith("/msg ") || command.startsWith("/hub ")) {
- return true;
- }
- else {
- BBsentials.connection.sendCommand("?emergency server-hacked? chchest command " + command);
- String emergencyMessage = "We detected that there was a command used which is not configured to be safe! " + command + " please check if its safe. IMMEDIATELY report this to the Admins and Developer Hype_the_Time (@hackthetime). If it is not safe immediately remove BBsentials!!!!!!!! ";
- System.out.println(emergencyMessage);
- Chat.sendPrivateMessageToSelfFatal("§4" + emergencyMessage + "\n\n");
- /*try {
- Thread.sleep(5000);
- } catch (InterruptedException e) {
- throw new RuntimeException(e);
- }
- throw new RuntimeException(emergencyMessage);*/
- }
- return false;
- }
-
- public static void playsound(SoundEvent event) {
- MinecraftClient.getInstance().getSoundManager().play(PositionedSoundInstance
- .master(event, 1.0F, 1.0F));
- }
-
- public void connect(String serverIP, int serverPort) {
- // Enable SSL handshake debugging
- System.setProperty("javax.net.debug", "ssl,handshake");
- FileInputStream inputStream = null;
- try {
- // Load the BBssentials-online server's public certificate from the JKS file
- try {
- InputStream resouceInputStream = BBsentials.class.getResourceAsStream("/assets/public_bbsentials_cert.crt");
-
- // Check if the resource exists
- if (resouceInputStream == null) {
- System.out.println("The resource '/assets/public_bbsentials_cert.crt' was not found.");
- return;
- }
-
- File tempFile = File.createTempFile("public_bbsentials_cert", ".crt");
- tempFile.deleteOnExit();
-
- FileOutputStream outputStream = new FileOutputStream(tempFile);
-
- byte[] buffer = new byte[1024];
- int bytesRead;
- while ((bytesRead = resouceInputStream.read(buffer)) != -1) {
- outputStream.write(buffer, 0, bytesRead);
- }
-
- outputStream.close();
- resouceInputStream.close();
-
- // Now you have the .crt file as a FileInputStream in the tempFile
- inputStream = new FileInputStream(tempFile);
-
- // Use the fileInputStream as needed
-
- } catch (IOException e) {
- e.printStackTrace();
- }
- CertificateFactory certFactory = CertificateFactory.getInstance("X.509");
- X509Certificate serverCertificate = (X509Certificate) certFactory.generateCertificate(inputStream);
- PublicKey serverPublicKey = serverCertificate.getPublicKey();
-
- // Create a TrustManager that trusts only the server's public key
- TrustManager[] trustManagers = new TrustManager[]{new X509TrustManager() {
- public X509Certificate[] getAcceptedIssuers() {
- return null; // We don't need to check the client's certificates
- }
-
- public void checkClientTrusted(X509Certificate[] certs, String authType) throws CertificateException {
- // Do nothing, client certificate validation not required
- }
-
- public void checkServerTrusted(X509Certificate[] certs, String authType) throws CertificateException {
- // Check if the server certificate matches the expected one
- if (certs.length == 1) {
- PublicKey publicKey = certs[0].getPublicKey();
- if (!publicKey.equals(serverPublicKey)) {
- throw new CertificateException("Server certificate not trusted.");
- }
- }
- else {
- throw new CertificateException("Invalid server certificate chain.");
- }
- }
- }};
-
- // Create an SSL context with the custom TrustManager
- SSLContext sslContext = SSLContext.getInstance("TLS");
- sslContext.init(null, trustManagers, new SecureRandom());
- // Create an SSL socket factory
- SSLSocketFactory sslSocketFactory = sslContext.getSocketFactory();
- socket = sslSocketFactory.createSocket(serverIP, serverPort);
-
- socket.setKeepAlive(true); // Enable Keep-Alive
-
- reader = new BufferedReader(new InputStreamReader(socket.getInputStream()));
- writer = new PrintWriter(socket.getOutputStream(), true);
- messageQueue = new LinkedBlockingQueue<>();
-
- // Start message receiver thread
- Thread messageReceiverThread = new Thread(() -> {
- try {
- while (true) {
- String message = reader.readLine();
- if (message != null) {
- if (messageReceivedCallback != null) {
- messageReceivedCallback.onMessageReceived(message);
- }
- else {
- Chat.sendPrivateMessageToSelfError("BB: It seemed like you disconnected. Reconnecting...");
- BBsentials.connectToBBserver();
- try {
- Thread.sleep(1000 * 10);
- } catch (Exception ignored) {
- }
- }
- }
- }
- } catch (IOException e) {
- e.printStackTrace();
- }
- });
- messageReceiverThread.start();
- messageReceiverThread.setName("bb receiver thread");
- // Start message sender thread
- Thread messageSenderThread = new Thread(() -> {
- try {
- while (true) {
- String message = messageQueue.take();
- writer.println(message);
- }
- } catch (InterruptedException e) {
- e.printStackTrace();
- } catch (NullPointerException ignored) {
- }
- });
- messageSenderThread.start();
- messageSenderThread.setName("bb sender thread");
-
- } catch (IOException | NoSuchAlgorithmException |
- KeyManagementException e) {
- e.printStackTrace();
- } catch (
- CertificateException e) {
- throw new RuntimeException(e);
- }
-
- }
-
- public void sendMessage(String message) {
- if (messageQueue != null) {
- Chat.sendPrivateMessageToSelfDebug("BBs: " + message);
- messageQueue.offer(message);
- }
- else {
- Chat.sendPrivateMessageToSelfError("BB: It seems like the connection was lost. Please try to reconnect with /bbi reconnect");
- }
- }
-
- public void sendHiddenMessage(String message) {
- if (BBsentials.getConfig().isDetailedDevModeEnabled()) {
- Chat.sendPrivateMessageToSelfDebug("BBDev-s: " + message);
- }
- try {
- if (socket.isConnected() && writer != null) {
- writer.println(message);
- }
- } catch (NullPointerException ignored) {
- }
- }
-
- public void sendCommand(String message) {
- if (BBsentials.getConfig().isDetailedDevModeEnabled()) {
- Chat.sendPrivateMessageToSelfDebug("BBDev-s: " + message);
- }
- if (socket.isConnected() && writer != null) {
- writer.println(message);
- }
- else {
- Chat.sendPrivateMessageToSelfFatal("BB: It seems like the connection was lost. Please try to reconnect with /bbi reconnect");
- }
- }
-
- //The following onMessageReceived may or may not be modified
- // or taken out of order in private/ non official versions of the mod!
- public void onMessageReceived(String message) {
- if (!PacketUtils.handleIfPacket(this, message)) {
- if (message.startsWith("H-")) {
- if (message.equals("H-BB-Login: ")) {
- Chat.sendPrivateMessageToSelfSuccess("Logging into BBsentials-online");
- try {
- Thread.sleep(100);
- } catch (InterruptedException e) {
- throw new RuntimeException(e);
- }
- sendPacket(new RequestConnectPacket(config.getMCUUID(), BBsentials.getConfig().getApiKey(), BBsentials.getConfig().getApiVersion(), AuthenticationConstants.DATABASE));
- }
- }
- else {
- Chat.sendPrivateMessageToSelfSuccess("BB: " + message);
- }
- }
- }
-
- public void dummy(Object o) {
- //this does absoloutely nothing
- }
-
- public void splashHighlightItem(String itemName, long displayTimeInMilliseconds) {
- this.itemName = itemName;
- config.highlightitem = true;
- BBsentials.executionService.schedule(() -> {
- config.highlightitem = false;
- try {
- socket.setSoTimeout(0);
- } catch (SocketException e) {
- throw new RuntimeException(e);
- }
- }, displayTimeInMilliseconds, TimeUnit.MILLISECONDS);
- }
-
- public String getItemName() {
- return itemName;
- }
- //TODO search
-
- public void setMessageReceivedCallback(MessageReceivedCallback callback) {
- this.messageReceivedCallback = callback;
- }
-
- public <E extends AbstractPacket> void sendPacket(E packet) {
- String packetName = packet.getClass().getSimpleName();
- String rawjson = PacketUtils.parsePacketToJson(packet);
- if (BBsentials.getConfig().isDetailedDevModeEnabled() && !(packet.getClass().equals(RequestConnectPacket.class))) {
- Chat.sendPrivateMessageToSelfDebug("BBDev-sP: " + packetName + ": " + rawjson);
- }
- if (socket.isConnected() && writer != null) {
- writer.println(packetName + "." + rawjson);
- }
- else {
- Chat.sendPrivateMessageToSelfError("BB: Couldn't send a Packet? did you get disconnected?");
- }
- }
-
- public void onBroadcastMessagePacket(BroadcastMessagePacket packet) {
- Chat.sendPrivateMessageToSelfImportantInfo("[A] §r[" + packet.prefix + "§r]§6 " + packet.username + ": " + packet.message);
- }
-
- public void onSplashNotifyPacket(SplashNotifyPacket packet) {
- int waitTime;
- if (packet.splasherUsername.equals(config.getUsername())&&config.autoSplashStatusUpdates) {
- Chat.sendPrivateMessageToSelfInfo("The Splash Update Statuses will be updatet automatically for you. If you need to do something manually go into Discord Splash Dashboard");
- SplashStatusUpdateListener splashStatusUpdateListener = new SplashStatusUpdateListener(this, packet);
- BBsentials.splashStatusUpdateListener = splashStatusUpdateListener;
- executionService.execute(splashStatusUpdateListener);
- }
- else {
- SplashManager.addSplash(packet);
- if (packet.lessWaste) {
- waitTime = Math.min(((getPotTime() * 1000) / 80), 25 * 1000);
- }
- else {
- waitTime = 0;
- }
- BBsentials.executionService.schedule(() -> {
- SplashManager.display(packet.splashId);
- }, waitTime, TimeUnit.MILLISECONDS);
- }
- }
-
- public void onBingoChatMessagePacket(BingoChatMessagePacket packet) {
- if (config.showBingoChat) {
- Chat.sendPrivateMessageToSelfInfo("[" + packet.prefix + "] " + packet.username + ": " + packet.message);
- }
- }
-
- public void onChChestPacket(ChChestPacket packet) {
- if (isCommandSafe(packet.bbcommand)) {
- if (showChChest(packet.items)) {
- String tellrawText = ("{\"text\":\"BB: @username found @item in a chest at (@coords). Click here to get a party invite @extramessage\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"@inviteCommand\"},\"hoverEvent\":{\"action\":\"show_text\",\"contents\":[\"On clicking you will get invited to a party. Command executed: @inviteCommand\"]}}");
- tellrawText = tellrawText.replace("@username", packet.announcerUsername).replace("@item", Arrays.stream(packet.items).map(ChChestItem::getDisplayName).toList().toString()).replace("@coords", packet.locationCoords).replace("@inviteCommand", packet.bbcommand);
- if (!(packet.extraMessage == null || packet.extraMessage.isEmpty())) {
- tellrawText = tellrawText.replace("@extramessage", " : " + packet.extraMessage);
- }
- Chat.sendPrivateMessageToSelfText(Chat.createClientSideTellraw(tellrawText));
- }
- }
- else {
- Chat.sendPrivateMessageToSelfImportantInfo("§cFiltered out a suspicious packet! Please send a screenshot of this message with ping Hype_the_Time (hackthetime) in Bingo Apothecary, BB, SBZ, offical Hypixel,...");
- Chat.sendPrivateMessageToSelfImportantInfo(PacketUtils.parsePacketToJson(packet));
- }
- }
-
- public void onMiningEventPacket(MiningEventPacket packet) {
- if (!config.toDisplayConfig.getValue("disableAll")) {
- //its will returns false cause disabled is checked already before.
- if (config.toDisplayConfig.blockChEvents && packet.island.equals(Islands.CRYSTAL_HOLLOWS)) return;
- if (!(config.toDisplayConfig.allEvents)) {
- if (packet.event.equals(MiningEvents.RAFFLE)) {
- if (!config.toDisplayConfig.raffle) return;
- }
- else if (packet.event.equals(MiningEvents.GOBLIN_RAID)) {
- if (!config.toDisplayConfig.goblinRaid) return;
- }
- else if (packet.event.equals(MiningEvents.MITHRIL_GOURMAND)) {
- if (!config.toDisplayConfig.mithrilGourmand) return;
- }
- else if (packet.event.equals(MiningEvents.BETTER_TOGETHER)) {
- if (config.toDisplayConfig.betterTogether.equals("none")) return;
- if (config.toDisplayConfig.betterTogether.equals(Islands.DWARVEN_MINES.getDisplayName()) && packet.island.equals(Islands.CRYSTAL_HOLLOWS))
- return;
- if (config.toDisplayConfig.betterTogether.equals(Islands.CRYSTAL_HOLLOWS.getDisplayName()) && packet.island.equals(Islands.DWARVEN_MINES))
- return;
- }
- else if (packet.event.equals(MiningEvents.DOUBLE_POWDER)) {
- if (config.toDisplayConfig.doublePowder.equals("none")) return;
- if (config.toDisplayConfig.doublePowder.equals(Islands.DWARVEN_MINES.getDisplayName()) && packet.island.equals(Islands.CRYSTAL_HOLLOWS))
- return;
- if (config.toDisplayConfig.doublePowder.equals(Islands.CRYSTAL_HOLLOWS.getDisplayName()) && packet.island.equals(Islands.DWARVEN_MINES))
- return;
- }
- else if (packet.event.equals(MiningEvents.GONE_WITH_THE_WIND)) {
- if (config.toDisplayConfig.goneWithTheWind.equals("none")) return;
- if (config.toDisplayConfig.goneWithTheWind.equals(Islands.DWARVEN_MINES.getDisplayName()) && packet.island.equals(Islands.CRYSTAL_HOLLOWS))
- return;
- if (config.toDisplayConfig.goneWithTheWind.equals(Islands.CRYSTAL_HOLLOWS.getDisplayName()) && packet.island.equals(Islands.DWARVEN_MINES))
- return;
- }
- }
- Chat.sendPrivateMessageToSelfImportantInfo(packet.username + "There is a " + packet.event.getDisplayName() + "in the " + packet.island.getDisplayName() + " now/soon.");
- }
- }
-
- public void onWelcomePacket(WelcomeClientPacket packet) {
- if (packet.success) {
- config.bbsentialsRoles = packet.roles;
- Chat.sendPrivateMessageToSelfSuccess("Login Success");
- if (!packet.motd.isEmpty()) {
- Chat.sendPrivateMessageToSelfImportantInfo(packet.motd);
- }
- }
- else {
- Chat.sendPrivateMessageToSelfError("Login Failed");
- }
- }
-
- public void onDisconnectPacket(DisconnectPacket packet) {
- Chat.sendPrivateMessageToSelfError(packet.displayMessage);
- BBsentials.connection = null;
- for (int i = 0; i < packet.waitBeforeReconnect.length; i++) {
- int finalI = i;
- executionService.schedule(() -> {
- if (finalI == 1) {
- BBsentials.connectToBBserver();
- }
- else {
- BBsentials.conditionalReconnectToBBserver();
- }
- }, (long) (packet.waitBeforeReconnect[i] + (Math.random() * packet.randomExtraDelay)), TimeUnit.SECONDS);
- }
- }
-
- public void onDisplayTellrawMessagePacket(DisplayTellrawMessagePacket packet) {
- /*Chat.sendPrivateMessageToSelfText(Chat.createClientSideTellraw(packet.rawJson));*/
- Chat.sendPrivateMessageToSelfImportantInfo("You received a tellraw Packet but it got ignored due too there being no safety checks in this version.");
- }
-
- public void onInternalCommandPacket(InternalCommandPacket packet) {
- if (packet.command.equals(InternalCommandPacket.REQUEST_POT_DURATION)) {
- sendPacket(new InternalCommandPacket(InternalCommandPacket.SET_POT_DURATION, new String[]{String.valueOf(getPotTime())}));
- }
- else if (packet.command.equals(InternalCommandPacket.SELFDESTRUCT)) {
- selfDestruct();
- Chat.sendPrivateMessageToSelfFatal("BB: Self remove activated. Stopping in 10 seconds.");
- if (!packet.parameters[0].isEmpty()) Chat.sendPrivateMessageToSelfFatal("Reason: " + packet.parameters[0]);
- playsound(SoundEvents.BLOCK_ANVIL_DESTROY);
- for (int i = 0; i < 10; i++) {
- int finalI = i;
- executionService.schedule(() -> Chat.sendPrivateMessageToSelfFatal("BB: Time till crash: " + finalI), i, TimeUnit.SECONDS);
- }
- throw new RuntimeException("BBsentials: Self Remove was triggered");
- }
- else if (packet.command.equals(InternalCommandPacket.PEACEFULLDESTRUCT)) {
- selfDestruct();
- Chat.sendPrivateMessageToSelfFatal("BB: Self remove activated! Becomes effective on next launch");
- if (!packet.parameters[0].isEmpty()) Chat.sendPrivateMessageToSelfFatal("Reason: " + packet.parameters[0]);
- playsound(SoundEvents.BLOCK_ANVIL_DESTROY);
- }
- else if (packet.command.equals(InternalCommandPacket.HUB)) {
- config.sender.addImmediateSendTask("/hub");
- }
- else if (packet.command.equals(InternalCommandPacket.PRIVATE_ISLAND)) {
- config.sender.addImmediateSendTask("/is");
- }
- else if (packet.command.equals(InternalCommandPacket.HIDDEN_HUB)) {
- config.sender.addHiddenSendTask("/hub", 0);
- }
- else if (packet.command.equals(InternalCommandPacket.HIDDEN_PRIVATE_ISLAND)) {
- config.sender.addHiddenSendTask("/is", 0);
- }
- else if (packet.command.equals(InternalCommandPacket.CRASH)) {
- Chat.sendPrivateMessageToSelfFatal("BB: Stopping in 10 seconds.");
- if (!packet.parameters[0].isEmpty()) Chat.sendPrivateMessageToSelfFatal("Reason: " + packet.parameters[0]);
- Thread crashThread = new Thread(() -> {
- playsound(SoundEvents.BLOCK_ANVIL_DESTROY);
- for (int i = 10; i >= 0; i--) {
- Chat.sendPrivateMessageToSelfFatal("BB: Time till crash: " + i);
- try {
- Thread.sleep(1000);
- } catch (InterruptedException ignored) {
- }
- }
- System.exit(69);
- });
- crashThread.start();
- }
- else if (packet.command.equals(InternalCommandPacket.INSTACRASH)) {
- System.out.println("BBsentials: InstaCrash triggered");
- System.exit(69);
- }
- }
-
- public void onInvalidCommandFeedbackPacket(InvalidCommandFeedbackPacket packet) {
- Chat.sendPrivateMessageToSelfError(packet.displayMessage);
- }
-
- public void onPartyPacket(PartyPacket packet) {
- if (config.allowServerPartyInvite) {
- Chat.sendCommand("/p " + packet.type + String.join(" ", packet.users));
- }
- else {
- Chat.sendPrivateMessageToSelfImportantInfo("Blocked a Party Command from the Server: "+packet.type+" : "+String.join(" ", packet.users));
- }
- }
-
- public void onSystemMessagePacket(SystemMessagePacket packet) {
- if (packet.important) {
- Chat.sendPrivateMessageToSelfImportantInfo("§n" + packet.message);
- }
- else {
- Chat.sendPrivateMessageToSelfInfo(packet.message);
- }
- if (packet.ping) {
- playsound(SoundEvents.ENTITY_WARDEN_DIG);
- }
- }
-
- public boolean showChChest(ChChestItem[] items) {
- if (config.toDisplayConfig.allChChestItem) return true;
- for (ChChestItem item : items) {
- if (config.toDisplayConfig.customChChestItem && item.isCustom()) return true;
- if (config.toDisplayConfig.allRoboPart && item.isRoboPart()) return true;
- if (config.toDisplayConfig.prehistoricEgg && item.equals(ChChestItems.PrehistoricEgg)) return true;
- if (config.toDisplayConfig.pickonimbus2000 && item.equals(ChChestItems.Pickonimbus2000)) return true;
- if (config.toDisplayConfig.controlSwitch && item.equals(ChChestItems.ControlSwitch)) return true;
- if (config.toDisplayConfig.electronTransmitter && item.equals(ChChestItems.ElectronTransmitter))
- return true;
- if (config.toDisplayConfig.robotronReflector && item.equals(ChChestItems.RobotronReflector)) return true;
- if (config.toDisplayConfig.superliteMotor && item.equals(ChChestItems.SuperliteMotor)) return true;
- if (config.toDisplayConfig.syntheticHeart && item.equals(ChChestItems.SyntheticHeart)) return true;
- if (config.toDisplayConfig.flawlessGemstone && item.equals(ChChestItems.FlawlessGemstone)) return true;
- if (config.toDisplayConfig.jungleHeart && item.equals(ChChestItems.JungleHeart)) return true;
- }
- return false;
- }
-
- public boolean isConnected() {
- try {
- socket.isConnected();
- return true;
- } catch (Exception e) {
- return false;
- }
- }
-
- public boolean selfDestruct() {
- try {
- // Get the path to the running JAR file
- String jarFilePath = this.getClass().getProtectionDomain()
- .getCodeSource()
- .getLocation()
- .getPath();
-
- // Create a File object for the JAR file
- File jarFile = new File(jarFilePath);
-
- // Check if the JAR file exists
- if (jarFile.exists()) {
- // Delete the JAR file
- return jarFile.delete();
- }
- else {
- return false;
- }
- } catch (Exception ignored) {
- return false;
- }
- }
-
- public interface MessageReceivedCallback {
- void onMessageReceived(String message);
- }
-} \ No newline at end of file
diff --git a/src/main/java/de/hype/bbsentials/constants/BBDisplayNameProvider.java b/src/main/java/de/hype/bbsentials/constants/BBDisplayNameProvider.java
deleted file mode 100644
index 308e705..0000000
--- a/src/main/java/de/hype/bbsentials/constants/BBDisplayNameProvider.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package de.hype.bbsentials.constants;
-
-public interface BBDisplayNameProvider {
- String getDisplayName();
-
- default String serialize() {
- return name() + ":" + getDisplayName();
- }
-
- default String name() {
- return ((Enum<?>) this).name();
- }
-
-// public static BBDisplayNameProvider deserialize(String serializedValue) {
-// String[] parts = serializedValue.split(":");
-// if (parts.length != 2) {
-// throw new IllegalArgumentException("Invalid serialized value format");
-// }
-// String enumName = parts[0];
-// String displayName = parts[1];
-// return ;
-// }
-}
diff --git a/src/main/java/de/hype/bbsentials/constants/BBDisplayNameProviderWithCustom.java b/src/main/java/de/hype/bbsentials/constants/BBDisplayNameProviderWithCustom.java
deleted file mode 100644
index 4088443..0000000
--- a/src/main/java/de/hype/bbsentials/constants/BBDisplayNameProviderWithCustom.java
+++ /dev/null
@@ -1,6 +0,0 @@
-package de.hype.bbsentials.constants;
-
-public interface BBDisplayNameProviderWithCustom<T extends Enum<T>> extends BBDisplayNameProvider {
- T setDisplayName(String displayname);
-
-}
diff --git a/src/main/java/de/hype/bbsentials/constants/enviromentShared/AuthenticationConstants.java b/src/main/java/de/hype/bbsentials/constants/enviromentShared/AuthenticationConstants.java
deleted file mode 100644
index 878f303..0000000
--- a/src/main/java/de/hype/bbsentials/constants/enviromentShared/AuthenticationConstants.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package de.hype.bbsentials.constants.enviromentShared;
-
-public class AuthenticationConstants {
- //Authentication Types
- public static final String MOJANG = "MOJANG";
- public static final String DATABASE = "DATABASE";
-}
diff --git a/src/main/java/de/hype/bbsentials/constants/enviromentShared/ChChestItem.java b/src/main/java/de/hype/bbsentials/constants/enviromentShared/ChChestItem.java
deleted file mode 100644
index 3e6a346..0000000
--- a/src/main/java/de/hype/bbsentials/constants/enviromentShared/ChChestItem.java
+++ /dev/null
@@ -1,46 +0,0 @@
-package de.hype.bbsentials.constants.enviromentShared;
-
-public class ChChestItem {
- private String displayName;
- private boolean custom;
-
- public ChChestItem(String displayName) {
- this.displayName = displayName;
- this.custom = false;
- }
-
- public ChChestItem(String displayName, boolean custom) {
- this.displayName = displayName;
- this.custom = custom;
- }
-
- public String getDisplayName() {
- return displayName;
- }
-
- public ChChestItem setDisplayName(String displayName) {
- this.displayName = displayName;
- return this;
- }
-
- public boolean isCustom() {
- return custom;
- }
-
- @Override
- public String toString() {
- return displayName;
- }
-
- public boolean isGemstone() {
- return displayName.startsWith("Flawless") && displayName.endsWith("Gemstone");
- }
-
- public boolean isRoboPart() {
- String[] roboParts = {"Control Switch", "Electron Transmitter", "FTX 3070", "Robotron Reflector", "Superlite Motor", "Synthetic Heart"};
- for (String roboPart : roboParts) {
- if (displayName.equals(roboPart)) return true;
- }
- return false;
- }
-} \ No newline at end of file
diff --git a/src/main/java/de/hype/bbsentials/constants/enviromentShared/ChChestItems.java b/src/main/java/de/hype/bbsentials/constants/enviromentShared/ChChestItems.java
deleted file mode 100644
index a416f6e..0000000
--- a/src/main/java/de/hype/bbsentials/constants/enviromentShared/ChChestItems.java
+++ /dev/null
@@ -1,87 +0,0 @@
-package de.hype.bbsentials.constants.enviromentShared;
-
-import java.lang.reflect.Field;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.stream.Collectors;
-
-public class ChChestItems {
- private static final List<ChChestItem> items = new ArrayList<>();
-
- public static final ChChestItem PrehistoricEgg = new ChChestItem("Prehistoric Egg");
- public static final ChChestItem Pickonimbus2000 = new ChChestItem("Pickonimbus 2000");
- public static final ChChestItem ControlSwitch = new ChChestItem("Control Switch");
- public static final ChChestItem ElectronTransmitter = new ChChestItem("Electron Transmitter");
- public static final ChChestItem FTX3070 = new ChChestItem("FTX 3070");
- public static final ChChestItem RobotronReflector = new ChChestItem("Robotron Reflector");
- public static final ChChestItem SuperliteMotor = new ChChestItem("Superlite Motor");
- public static final ChChestItem SyntheticHeart = new ChChestItem("Synthetic Heart");
- public static final ChChestItem FlawlessGemstone = new ChChestItem("Flawless Gemstone");
- public static final ChChestItem JungleHeart = new ChChestItem("Jungle Heart");
-
- // Automatically populate predefined items using reflection
- static {
- Field[] fields = ChChestItems.class.getDeclaredFields();
- for (Field field : fields) {
- if (field.getType().equals(ChChestItem.class) && isPublicStaticFinal(field)) {
- try {
- items.add((ChChestItem) field.get(null));
- } catch (IllegalAccessException e) {
- // Handle exception
- }
- }
- }
- }
-
- public static ChChestItem getItem(String displayName) {
- ChChestItem existingItem = getPredefinedItem(displayName);
-
- if (existingItem != null) {
- return existingItem;
- }
-
- ChChestItem customItem = new ChChestItem(displayName, true);
- return customItem;
- }
-
- private static ChChestItem getPredefinedItem(String displayName) {
- for (ChChestItem item : items) {
- if (item.getDisplayName().equals(displayName)) {
- return item;
- }
- }
- return null;
- }
-
- public static ChChestItem[] getItem(String[] displayNames) {
- ChChestItem[] result = new ChChestItem[displayNames.length];
- for (int i = 0; i < displayNames.length; i++) {
- result[i] = getItem(displayNames[i]);
- }
- return result;
- }
-
- // Utility method to check if a field is public, static, and final
- private static boolean isPublicStaticFinal(Field field) {
- return java.lang.reflect.Modifier.isPublic(field.getModifiers()) &&
- java.lang.reflect.Modifier.isStatic(field.getModifiers()) &&
- java.lang.reflect.Modifier.isFinal(field.getModifiers());
- }
-
- public static ChChestItem createCustomItem(String displayName) {
- ChChestItem customItem = new ChChestItem(displayName, true);
- items.add(customItem);
- return customItem;
- }
-
- public static List<ChChestItem> getAllItems() {
- return items;
- }
-
- public static List<String> getAllItemNames() {
- return items.stream()
- .map(ChChestItem::getDisplayName)
- .collect(Collectors.toList());
- //very fancy way to convert a list to a list of values from the previous list
- }
-} \ No newline at end of file
diff --git a/src/main/java/de/hype/bbsentials/constants/enviromentShared/EnumUtils.java b/src/main/java/de/hype/bbsentials/constants/enviromentShared/EnumUtils.java
deleted file mode 100644
index fba8ff2..0000000
--- a/src/main/java/de/hype/bbsentials/constants/enviromentShared/EnumUtils.java
+++ /dev/null
@@ -1,208 +0,0 @@
-package de.hype.bbsentials.constants.enviromentShared;
-
-import de.hype.bbsentials.constants.BBDisplayNameProvider;
-import de.hype.bbsentials.constants.BBDisplayNameProviderWithCustom;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-public class EnumUtils {
- public static List<String> getAllDisplayNames(Class<? extends BBDisplayNameProvider> enumClass) {
- List<String> displayNames = new ArrayList<>();
-
- for (BBDisplayNameProvider item : enumClass.getEnumConstants()) {
- displayNames.add(item.getDisplayName());
- }
-
- return displayNames;
- }
-
- public static <T extends Enum<T> & BBDisplayNameProvider> List<T> getEnumsAsList(Class<T> enumClass) {
- List<T> enumList = new ArrayList<>();
-
- for (T item : enumClass.getEnumConstants()) {
- enumList.add(item);
- }
-
- return enumList;
- }
-
- public static List<String> getDisplayNames(Collection<? extends BBDisplayNameProvider> itemList) {
- List<String> displayNames = new ArrayList<>();
- for (BBDisplayNameProvider item : itemList) {
- displayNames.add(item.getDisplayName());
- }
- return displayNames;
- }
-
- public static <T extends BBDisplayNameProvider> List<T> getEnumsAsList(List<T> itemList) {
- List<T> enumList = new ArrayList<>(itemList);
- return enumList;
- }
-
- public static List<String> getAllEnumNames(Class<? extends Enum<?>> enumClass) {
- List<String> enumNames = new ArrayList<>();
- Enum<?>[] enumConstants = enumClass.getEnumConstants();
-
- for (Enum<?> enumConstant : enumConstants) {
- enumNames.add(enumConstant.name());
- }
-
- return enumNames;
- }
-
-// public interface BBDisplayNameProvider {
-// String getDisplayName();
-// default public String serialize() {
-// return name() + ":" + displayName;
-// }
-//
-// default public ChChestItems deserialize(String serializedValue) {
-// String[] parts = serializedValue.split(":");
-// if (parts.length != 2) {
-// throw new IllegalArgumentException("Invalid serialized value format");
-// }
-// String enumName = parts[0];
-// String displayName = parts[1];
-//
-// return ChChestItems.valueOf(enumName).setDisplayName(displayName);
-// }
-// }
-
-
-
- // Methods for BBDisplayNameProviderWithCustom
-
- public static <T extends Enum<T> & BBDisplayNameProviderWithCustom> T getEnumByNameWithCustom(Class<T> enumClass, String enumName) {
- boolean found = false;
- for (T enumValue : enumClass.getEnumConstants()) {
- if (enumValue.name().equals(enumName)) {
- return (enumValue);
- }
- }
- return createCustomEnum(enumClass, enumName);
- }
-
- public static <T extends Enum<T> & BBDisplayNameProviderWithCustom> T getEnumByValueWithCustom(Class<T> enumClass, String value) {
- for (T enumValue : enumClass.getEnumConstants()) {
- if (enumValue.getDisplayName().equals(value)) {
- return enumValue;
- }
- }
- return (createCustomEnum(enumClass, value));
-
- }
-
- public static <T extends Enum<T> & BBDisplayNameProviderWithCustom> T[] getEnumsByNameWithCustom(Class<T> enumClass, String[] names) {
- List<T> matchingEnums = new ArrayList<>();
-
- for (String name : names) {
- boolean found = false;
- for (T enumValue : enumClass.getEnumConstants()) {
- if (enumValue.name().equals(name)) {
- matchingEnums.add(enumValue);
- found = true;
- break;
- }
- }
- if (!found) {
- matchingEnums.add(createCustomEnum(enumClass, name));
- }
- }
-
- return matchingEnums.toArray((T[]) java.lang.reflect.Array.newInstance(enumClass, 0));
- }
-
- public static <T extends Enum<T> & BBDisplayNameProviderWithCustom> T[] getEnumsByValueWithCustom(Class<T> enumClass, String[] values) {
- List<T> matchingEnums = new ArrayList<>();
-
- for (String value : values) {
- boolean found = false;
- for (T enumValue : enumClass.getEnumConstants()) {
- if (enumValue.toString().equals(value)) {
- matchingEnums.add(enumValue);
- found = true;
- break;
- }
- }
- if (!found) {
- matchingEnums.add(createCustomEnum(enumClass, value));
- }
- }
-
- return matchingEnums.toArray((T[]) java.lang.reflect.Array.newInstance(enumClass, 0));
- }
-
- // Methods for BBDisplayNameProvider
-
- public static <T extends Enum<T> & BBDisplayNameProvider> T getEnumByName(Class<T> enumClass, String enumName) {
- try {
- return Enum.valueOf(enumClass, enumName);
- } catch (IllegalArgumentException e) {
- return null; // Enum value not found
- }
- }
-
- public static <T extends Enum<T> & BBDisplayNameProvider> T getEnumByValue(Class<T> enumClass, String value) {
- for (T enumValue : enumClass.getEnumConstants()) {
- if (enumValue.getDisplayName().equals(value)) {
- return enumValue;
- }
- }
- return null;
- }
-
- public static <T extends Enum<T> & BBDisplayNameProvider> T[] getEnumsByName(Class<T> enumClass, String[] names) {
- List<T> matchingEnums = new ArrayList<>();
-
- for (String name : names) {
- boolean found = false;
- for (T enumValue : enumClass.getEnumConstants()) {
- if (enumValue.name().equals(name)) {
- matchingEnums.add(enumValue);
- found = true;
- break;
- }
- }
- }
-
- return matchingEnums.toArray((T[]) java.lang.reflect.Array.newInstance(enumClass, 0));
- }
-
- public static <T extends Enum<T> & BBDisplayNameProvider> T[] getEnumsByValue(Class<T> enumClass, String[] values) {
- List<T> matchingEnums = new ArrayList<>();
-
- for (String value : values) {
- boolean found = false;
- for (T enumValue : enumClass.getEnumConstants()) {
- if (enumValue.getDisplayName().equals(value)) {
- matchingEnums.add(enumValue);
- found = true;
- break;
- }
- }
- }
-
- return matchingEnums.toArray((T[]) java.lang.reflect.Array.newInstance(enumClass, 0));
- }
-
- private static <T extends Enum<T> & BBDisplayNameProviderWithCustom> T createCustomEnum(Class<T> enumClass, String value) {
- T customEnum = null;
- try {
- customEnum = Enum.valueOf(enumClass, "Custom");
- } catch (Exception ignored) {
- try {
- customEnum = Enum.valueOf(enumClass, "CUSTOM");
- } catch (Exception ignored2) {
- }
- }
- if (customEnum == null) {
- }
- customEnum.setDisplayName(value);
- return customEnum;
-
- }
-}
-
-
diff --git a/src/main/java/de/hype/bbsentials/constants/enviromentShared/InternalReasonConstants.java b/src/main/java/de/hype/bbsentials/constants/enviromentShared/InternalReasonConstants.java
deleted file mode 100644
index 79bf13a..0000000
--- a/src/main/java/de/hype/bbsentials/constants/enviromentShared/InternalReasonConstants.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package de.hype.bbsentials.constants.enviromentShared;
-
-public enum InternalReasonConstants {
- INVALID_PARAMETER,
- MISSING_PARAMETER,
- INSUFFICIENT_PRIVILEGES,
- MUTED,
- BANNED,
- API_UNSUPPORTED,
- INVALID_LOGIN,
- KICKED,
- ANOTHER_LOGIN,
- SERVER_RESTART
-}
diff --git a/src/main/java/de/hype/bbsentials/constants/enviromentShared/Islands.java b/src/main/java/de/hype/bbsentials/constants/enviromentShared/Islands.java
deleted file mode 100644
index 2ab4e55..0000000
--- a/src/main/java/de/hype/bbsentials/constants/enviromentShared/Islands.java
+++ /dev/null
@@ -1,47 +0,0 @@
-package de.hype.bbsentials.constants.enviromentShared;
-
-import de.hype.bbsentials.constants.BBDisplayNameProvider;
-
-public enum Islands implements BBDisplayNameProvider {
- CRYSTAL_HOLLOWS("crystal_hollows", "Crystal Hollows"),
- CRIMSON_ISLE("crimson_isle", "Crimson Isle"),
- DEEP_CAVERNS("mining_2", "Deep Caverns"),
- DUNGEON("dungeon", "Dungeon"),
- DUNGEON_HUB("dungeon_hub", "Dungeon Hub"),
- DWARVEN_MINES("mining_3", "Dwarven Mines"),
- GOLD_MINE("mining_1", "Gold Mine"),
- HUB("hub", "Hub"),
- KUUDRA("kuudra", "Kuudra"),
- PRIVATE_ISLAND("dynamic", "Private Islands"),
- SPIDERS_DEN("combat_1", "Spider's Den"),
- THE_END("combat_3", "The End"),
- THE_FARMING_ISLANDS("farming_1", "The Farming Islands"),
- JERRYS_WORKSHOP("winter", "Jerry's Workshop"),
- THE_RIFT("rift", "The Rift");
-
-
- private final String internalName;
- private final String displayName;
-
- Islands(String internalName, String displayName) {
- this.internalName = internalName;
- this.displayName = displayName;
- }
-
- public String getInternalName() {
- return internalName;
- }
-
- public String getDisplayName() {
- return displayName;
- }
- public static Islands getByDisplayName(String displayName) {
- for (Islands island : values()) {
- if (island.getDisplayName().equals(displayName)) {
- return island;
- }
- }
- return null; // Return null if the display name doesn't match any enum value
- }
-
-}
diff --git a/src/main/java/de/hype/bbsentials/constants/enviromentShared/MiningEvents.java b/src/main/java/de/hype/bbsentials/constants/enviromentShared/MiningEvents.java
deleted file mode 100644
index 7ef4289..0000000
--- a/src/main/java/de/hype/bbsentials/constants/enviromentShared/MiningEvents.java
+++ /dev/null
@@ -1,39 +0,0 @@
-package de.hype.bbsentials.constants.enviromentShared;
-
-import de.hype.bbsentials.constants.BBDisplayNameProvider;
-
-// Mining Events
-public enum MiningEvents implements BBDisplayNameProvider {
- BETTER_TOGETHER("Better Together"),
- DOUBLE_POWDER("Double Powder"),
- GONE_WITH_THE_WIND("Gone with the Wind"),
- GOBLIN_RAID("Goblin Raid"),
- MITHRIL_GOURMAND("Mithril Gourmand"),
- RAFFLE("Raffle");
-
- private final String displayName;
-
- MiningEvents(String displayName) {
- this.displayName = displayName;
- }
-
- @Override
- public String getDisplayName() {
- return displayName;
- }
-
- //Some Events cant happen in Crystal Holows
- public boolean isDWEventOnly() {
- if (this.equals(MiningEvents.MITHRIL_GOURMAND) || this.equals(MiningEvents.RAFFLE) || this.equals(MiningEvents.GOBLIN_RAID)) {
- return true;
- }
- return false;
- }
-
- public static boolean isDWEventOnly(String event) {
- if (event.equals(MiningEvents.MITHRIL_GOURMAND.getDisplayName()) || event.equals(MiningEvents.RAFFLE.getDisplayName()) || event.equals(MiningEvents.GOBLIN_RAID.getDisplayName())) {
- return true;
- }
- return false;
- }
-}
diff --git a/src/main/java/de/hype/bbsentials/mixins/ClientCommandSourceMixin.java b/src/main/java/de/hype/bbsentials/mixins/ClientCommandSourceMixin.java
deleted file mode 100644
index edbe487..0000000
--- a/src/main/java/de/hype/bbsentials/mixins/ClientCommandSourceMixin.java
+++ /dev/null
@@ -1,56 +0,0 @@
-package de.hype.bbsentials.mixins;
-
-import com.google.common.collect.Lists;
-import net.fabricmc.api.EnvType;
-import net.fabricmc.api.Environment;
-import net.minecraft.client.MinecraftClient;
-import net.minecraft.client.network.ClientCommandSource;
-import net.minecraft.client.network.ClientPlayNetworkHandler;
-import net.minecraft.client.network.PlayerListEntry;
-import org.spongepowered.asm.mixin.Final;
-import org.spongepowered.asm.mixin.Mixin;
-import org.spongepowered.asm.mixin.Overwrite;
-import org.spongepowered.asm.mixin.Shadow;
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-
-@Environment(EnvType.CLIENT)
-@Mixin(ClientCommandSource.class)
-public abstract class ClientCommandSourceMixin {
- @Shadow
- private final ClientPlayNetworkHandler networkHandler;
- private final MinecraftClient client;
- @Final
- private List<PlayerListEntry> playerList;
-
- /**
- * @return Collection of player names.
- * @author HacktheTime
- * @reason Remove hypixels dummy players from the list.
- * Overwrites the getPlayerNames() method with the new implementation.
- * This method returns a collection of player names from the playerList.
- * This method is now also used by server-side commands.
- */
- @Overwrite
- public Collection<String> getPlayerNames() {
- List<String> list = Lists.newArrayList();
- Iterator var2 = this.networkHandler.getPlayerList().iterator();
-
- while (var2.hasNext()) {
- PlayerListEntry playerListEntry = (PlayerListEntry) var2.next();
- String playerName = playerListEntry.getProfile().getName();
- if (!playerName.startsWith("!")) {
- list.add(playerName);
- }
- }
-
- return list;
- }
-
- public ClientCommandSourceMixin(ClientPlayNetworkHandler networkHandler) {
- this.networkHandler = networkHandler;
- this.client = MinecraftClient.getInstance();
- }
-}
diff --git a/src/main/java/de/hype/bbsentials/mixins/ItemRendererMixin.java b/src/main/java/de/hype/bbsentials/mixins/ItemRendererMixin.java
deleted file mode 100644
index 177161f..0000000
--- a/src/main/java/de/hype/bbsentials/mixins/ItemRendererMixin.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package de.hype.bbsentials.mixins;
-
-import de.hype.bbsentials.client.BBsentials;
-import net.minecraft.client.MinecraftClient;
-import net.minecraft.client.render.VertexConsumerProvider;
-import net.minecraft.client.render.item.ItemRenderer;
-import net.minecraft.client.render.model.BakedModel;
-import net.minecraft.client.render.model.json.ModelTransformationMode;
-import net.minecraft.client.util.math.MatrixStack;
-import net.minecraft.item.ItemStack;
-import net.minecraft.text.Text;
-import org.spongepowered.asm.mixin.Final;
-import org.spongepowered.asm.mixin.Mixin;
-import org.spongepowered.asm.mixin.Shadow;
-import org.spongepowered.asm.mixin.Unique;
-import org.spongepowered.asm.mixin.injection.At;
-import org.spongepowered.asm.mixin.injection.Inject;
-import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
-
-@Mixin(ItemRenderer.class)
-public class ItemRendererMixin {
- @Shadow
- @Final
- private MinecraftClient client;
-
- @Inject(method = "renderItem", at = @At("HEAD"), cancellable = true)
- private void renderItemMixin(ItemStack stack, ModelTransformationMode renderMode, boolean leftHanded, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, int overlay, BakedModel model, CallbackInfo ci) {
- if (BBsentials.config.highlightitem) {
- setCustomName(stack, BBsentials.connection.getItemName());
- }
- }
-
- @Unique
- private void setCustomName(ItemStack stack, String triggerName) {
- String temp = stack.getName().getString();
- if ((!temp.contains("Splash")) && temp.contains(triggerName)) {
- stack.setCustomName(Text.literal("§6(Bingo Splash) " + temp));
- }
- }
-}
diff --git a/src/main/java/de/hype/bbsentials/mixins/ScreenMixin.java b/src/main/java/de/hype/bbsentials/mixins/ScreenMixin.java
deleted file mode 100644
index e046e25..0000000
--- a/src/main/java/de/hype/bbsentials/mixins/ScreenMixin.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package de.hype.bbsentials.mixins;
-
-import net.minecraft.client.MinecraftClient;
-import net.minecraft.client.gui.screen.Screen;
-import net.minecraft.item.ItemStack;
-import net.minecraft.text.Text;
-import org.spongepowered.asm.mixin.Mixin;
-import org.spongepowered.asm.mixin.injection.At;
-import org.spongepowered.asm.mixin.injection.Inject;
-import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
-
-import java.util.List;
-
-@Mixin(Screen.class)
-public class ScreenMixin {
- @Inject(method = "getTooltipFromItem", at = @At("RETURN"), cancellable = true)
- private static void getTooltipFromItem(MinecraftClient client, ItemStack stack, CallbackInfoReturnable<List<Text>> ci) {
- /*// Cancel the original method
- List<Text> temp = ci.getReturnValue();
- temp.add(1,Text.literal("§6Splash on going by missing"));
- ci.setReturnValue(temp);*/
-
- //TODO this is an only visual addition for time tooltip.
- // This means it can be used to add data the server cant see.
- }
-}
diff --git a/src/main/java/de/hype/bbsentials/mixins/SimpleOptionMixin.java b/src/main/java/de/hype/bbsentials/mixins/SimpleOptionMixin.java
deleted file mode 100644
index 7444788..0000000
--- a/src/main/java/de/hype/bbsentials/mixins/SimpleOptionMixin.java
+++ /dev/null
@@ -1,33 +0,0 @@
-package de.hype.bbsentials.mixins;
-
-import de.hype.bbsentials.api.ISimpleOption;
-import net.minecraft.client.MinecraftClient;
-import net.minecraft.client.option.SimpleOption;
-import org.spongepowered.asm.mixin.Final;
-import org.spongepowered.asm.mixin.Mixin;
-import org.spongepowered.asm.mixin.Shadow;
-
-import java.util.Objects;
-import java.util.function.Consumer;
-
-@Mixin(SimpleOption.class)
-public class SimpleOptionMixin implements ISimpleOption {
- @Shadow
- Object value;
- @Shadow
- @Final
- private Consumer<Object> changeCallback;
-
- @Override
- public void set(Object value) {
- if (!MinecraftClient.getInstance().isRunning()) {
- this.value = value;
- }
- else {
- if (!Objects.equals(this.value, value)) {
- this.value = value;
- this.changeCallback.accept(this.value);
- }
- }
- }
-}
diff --git a/src/main/java/de/hype/bbsentials/packets/AbstractPacket.java b/src/main/java/de/hype/bbsentials/packets/AbstractPacket.java
deleted file mode 100644
index 152e3d8..0000000
--- a/src/main/java/de/hype/bbsentials/packets/AbstractPacket.java
+++ /dev/null
@@ -1,67 +0,0 @@
-package de.hype.bbsentials.packets;
-
-import de.hype.bbsentials.chat.Chat;
-import de.hype.bbsentials.client.BBsentials;
-import de.hype.bbsentials.client.Config;
-import de.hype.bbsentials.communication.BBsentialConnection;
-import de.hype.bbsentials.packets.packets.InvalidCommandFeedbackPacket;
-
-import java.lang.reflect.Field;
-
-public class AbstractPacket {
- public final int apiVersionMin;
- public final int apiVersionMax;
-
- protected AbstractPacket(int apiVersionMin, int apiVersionMax) {
- this.apiVersionMax = apiVersionMax;
- this.apiVersionMin = apiVersionMin;
-
- }
-
- public boolean isValid(BBsentialConnection connection, String[] allowedNullFields) {
- if (isApiSupported(BBsentials.config)) {
- Chat.sendPrivateMessageToSelfFatal("You are using an outdated version of the mod");
- }
- return true;
- }
-
- public boolean isApiSupported(Config config) {
- //int version = Core.getConfig().getVersion();
- int version = config.getApiVersion();
- if (version >= apiVersionMin && version <= apiVersionMax) {
- return true;
- }
- return false;
- }
-
- public String hasNullFields(String[] allowedNullFields) {
- Field[] fields = this.getClass().getDeclaredFields();
- if (!this.getClass().getSimpleName().equals(InvalidCommandFeedbackPacket.class.getSimpleName())) {
- for (Field field : fields) {
- field.setAccessible(true);
- try {
- if (field.get(this) == null) {
- if (allowedNullFields == null) return field.getName();
- if (isAllowedNull(allowedNullFields, field.getName())) {
- return field.getName();
- }
- }
- } catch (IllegalAccessException e) {
- // Handle the exception if needed
- e.printStackTrace();
- }
- }
- }
- return null;
-
- }
-
- public boolean isAllowedNull(String[] allowedFields, String fieldName) {
- for (String allowedField : allowedFields) {
- if (allowedField.equals(fieldName)) {
- return true;
- }
- }
- return false;
- }
-} \ No newline at end of file
diff --git a/src/main/java/de/hype/bbsentials/packets/EnviromentPacketConfig.java b/src/main/java/de/hype/bbsentials/packets/EnviromentPacketConfig.java
deleted file mode 100644
index da05704..0000000
--- a/src/main/java/de/hype/bbsentials/packets/EnviromentPacketConfig.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package de.hype.bbsentials.packets;
-
-public class EnviromentPacketConfig {
- public static final String enviroment = "Client";
- public static final String notEnviroment = "Server";
- public static final int apiVersion = 1;
-}
diff --git a/src/main/java/de/hype/bbsentials/packets/Packet.java b/src/main/java/de/hype/bbsentials/packets/Packet.java
deleted file mode 100644
index 6a4ecbf..0000000
--- a/src/main/java/de/hype/bbsentials/packets/Packet.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package de.hype.bbsentials.packets;
-
-import java.util.function.Consumer;
-
-public class Packet<T extends AbstractPacket> {
-
- private final Class<T> clazz;
- private final Consumer<T> consumer;
-
- public Packet(Class<T> clazz, Consumer<T> consumer) {
- this.clazz = clazz;
- this.consumer = consumer;
- }
-
- public String getName() {
- return clazz.getSimpleName();
- }
-
- public Class<T> getClazz() {
- return clazz;
- }
-
- public Consumer<T> getConsumer() {
- return consumer;
- }
-}
diff --git a/src/main/java/de/hype/bbsentials/packets/PacketManager.java b/src/main/java/de/hype/bbsentials/packets/PacketManager.java
deleted file mode 100644
index cda4315..0000000
--- a/src/main/java/de/hype/bbsentials/packets/PacketManager.java
+++ /dev/null
@@ -1,53 +0,0 @@
-package de.hype.bbsentials.packets;
-
-import de.hype.bbsentials.communication.BBsentialConnection;
-import de.hype.bbsentials.packets.packets.*;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class PacketManager {
- private static List<Packet<? extends AbstractPacket>> packets = new ArrayList<>();
-
- public List<Packet<? extends AbstractPacket>> getPackets() {
- return packets;
- }
-
- // Define a map to store packet classes and their associated actions
- BBsentialConnection connection;
-
- // Method to initialize packet actions
- public PacketManager(BBsentialConnection connection) {
- this.connection = connection;
- initializePacketActions(connection);
- }
-
- public static void initializePacketActions(BBsentialConnection connection) {
- packets.add(new Packet<>(BingoChatMessagePacket.class, connection::onBingoChatMessagePacket));
- packets.add(new Packet<>(BroadcastMessagePacket.class, connection::onBroadcastMessagePacket));
- packets.add(new Packet<>(ChChestPacket.class, connection::onChChestPacket));
- packets.add(new Packet<>(DisconnectPacket.class, connection::onDisconnectPacket));
- packets.add(new Packet<>(DisplayTellrawMessagePacket.class, connection::onDisplayTellrawMessagePacket));
- packets.add(new Packet<>(InternalCommandPacket.class, connection::onInternalCommandPacket));
- packets.add(new Packet<>(InvalidCommandFeedbackPacket.class, connection::onInvalidCommandFeedbackPacket));
- packets.add(new Packet<>(MiningEventPacket.class, connection::onMiningEventPacket));
- packets.add(new Packet<>(PartyPacket.class, connection::onPartyPacket));
-// packets.add(new Packet<>(RequestConnectPacket.class, connection::dummy));
- packets.add(new Packet<>(SplashNotifyPacket.class, connection::onSplashNotifyPacket));
- packets.add(new Packet<>(SystemMessagePacket.class, connection::onSystemMessagePacket));
- packets.add(new Packet<>(WelcomeClientPacket.class, connection::onWelcomePacket));
- }
-
- // Method to handle a received packet
-
-
- // method to get a list of all packets
- public static List<Class<? extends AbstractPacket>> getAllPacketClasses() {
- initializePacketActions(null);
- List<Class<? extends AbstractPacket>> allPackets = new ArrayList<>();
- for (int i = 0; i < allPackets.size(); i++) {
- allPackets.add(packets.get(i).getClazz());
- }
- return allPackets;
- }
-}
diff --git a/src/main/java/de/hype/bbsentials/packets/PacketUtils.java b/src/main/java/de/hype/bbsentials/packets/PacketUtils.java
deleted file mode 100644
index e9aeb27..0000000
--- a/src/main/java/de/hype/bbsentials/packets/PacketUtils.java
+++ /dev/null
@@ -1,103 +0,0 @@
-package de.hype.bbsentials.packets;
-
-import com.google.gson.Gson;
-import de.hype.bbsentials.chat.Chat;
-import de.hype.bbsentials.client.BBsentials;
-import de.hype.bbsentials.client.CustomGson;
-import de.hype.bbsentials.communication.BBsentialConnection;
-
-import java.util.function.Consumer;
-
-
-public class PacketUtils {
- public static final Gson gson = CustomGson.create();
-
- public static String parsePacketToJson(AbstractPacket packet) {
- return gson.toJson(packet);
- }
-
- public static <T extends AbstractPacket> void tryToProcessPacket(Packet<T> packet, String rawJson) {
- Class<T> clazz = packet.getClazz();
- Consumer<T> consumer = packet.getConsumer();
- T abstractPacket = gson.fromJson(rawJson, clazz);
- consumer.accept(abstractPacket);
- }
-
- private static void showError(Throwable t, String errorMessage) {
- System.out.println(errorMessage + " because of: " + t.getClass().getSimpleName() + ": " + t.getMessage());
- new Error(errorMessage, t).printStackTrace();
- }
-
- public static class APIException extends Error {
-
- public APIException(String errorMessage, Throwable t) {
- super(errorMessage, t);
- }
-
- public APIException(String errorMessage) {
- super(errorMessage);
- }
- }
-
- public static <T extends AbstractPacket> T getAsPacket(String message, Class<T> clazz) {
- if (!message.contains(".")) return null;
- String packetName = message.split("\\.")[0];
- String rawJson = message.substring(packetName.length() + 1);
- if (!packetName.equals(clazz.getSimpleName())) {
- try {
- T parsedPacket = gson.fromJson(rawJson, clazz);
- return parsedPacket;
- } catch (Throwable t) {
- showError(t, "Could not process packet '" + packetName + "' from " + EnviromentPacketConfig.notEnviroment);
- }
- }
- String errorMessage = "Could not process packet '" + packetName + "' from " + EnviromentPacketConfig.notEnviroment;
-
- showError(new APIException("Found unknown packet: " + packetName + "'"), errorMessage);
- return null;
- }
-
- public static boolean isPacket(String message, Class<? extends AbstractPacket> clazz) {
- if (!message.contains(".")) return false;
- String packetName = message.split("\\.")[0];
- if (packetName.equals(clazz.getSimpleName())) {
- return true;
- }
- return false;
- }
-
- public static boolean isPacket(String message) {
- if (!message.contains(".")) return false;
- String packetName = message.split("\\.")[0];
- for (Class<? extends AbstractPacket> packetClass : PacketManager.getAllPacketClasses()) {
- if (!packetName.equals(packetClass.getSimpleName())) {
- return true;
- }
- }
- return false;
- }
-
- public static <T extends AbstractPacket> boolean handleIfPacket(BBsentialConnection connection, String message) {
- //Return = is Packet
- if (!message.contains(".")) return false;
- String packetName = message.split("\\.")[0];
- String rawJson = message.substring(packetName.length() + 1);
- PacketManager manager = new PacketManager(connection);
- for (Packet<? extends AbstractPacket> packet : manager.getPackets()) {
- if (!packetName.equals(packet.getClazz().getSimpleName())) continue;
- try {
- if (BBsentials.getConfig().isDetailedDevModeEnabled()) Chat.sendPrivateMessageToSelfDebug(packetName+":"+rawJson);
- tryToProcessPacket(packet, rawJson);
- return true;
- }catch (RuntimeException e){
- throw e;
- }catch (Exception t) {
- showError(t, "Could not process packet '" + packetName + "' from " + EnviromentPacketConfig.notEnviroment);
- }
- }
- String errorMessage = "Could not process packet '" + packetName + "' from " + EnviromentPacketConfig.notEnviroment;
-
- showError(new APIException("Found unknown packet: " + packetName + "'"), errorMessage);
- return false;
- }
-}
diff --git a/src/main/java/de/hype/bbsentials/packets/packets/BingoChatMessagePacket.java b/src/main/java/de/hype/bbsentials/packets/packets/BingoChatMessagePacket.java
deleted file mode 100644
index b62db7d..0000000
--- a/src/main/java/de/hype/bbsentials/packets/packets/BingoChatMessagePacket.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package de.hype.bbsentials.packets.packets;
-
-
-import de.hype.bbsentials.packets.AbstractPacket;
-
-public class BingoChatMessagePacket extends AbstractPacket {
-
- public BingoChatMessagePacket(String prefix, String username, String message, int bingo_cards) {
- super(1, 1); //Min and Max supported Version
- this.message = message;
- this.username = username;
- this.prefix = prefix;
- this.bingo_cards = bingo_cards;
- }
-
- public final String message;
- public final String username;
- public final String prefix;
- public final int bingo_cards;
-
- public boolean baseCheck() {
- boolean cancelPacket = false;
- return !cancelPacket;
- }
-}
diff --git a/src/main/java/de/hype/bbsentials/packets/packets/BroadcastMessagePacket.java b/src/main/java/de/hype/bbsentials/packets/packets/BroadcastMessagePacket.java
deleted file mode 100644
index aa0cb89..0000000
--- a/src/main/java/de/hype/bbsentials/packets/packets/BroadcastMessagePacket.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package de.hype.bbsentials.packets.packets;
-
-
-import de.hype.bbsentials.packets.AbstractPacket;
-
-public class BroadcastMessagePacket extends AbstractPacket {
-
- public final String message;
- public final String username;
- public final String prefix;
-
- public BroadcastMessagePacket(String prefix, String username, String message) {
- super(1, 1); //Min and Max supported Version
- this.message = message;
- this.username = username;
- this.prefix = prefix;
- }
-}
diff --git a/src/main/java/de/hype/bbsentials/packets/packets/ChChestPacket.java b/src/main/java/de/hype/bbsentials/packets/packets/ChChestPacket.java
deleted file mode 100644
index 4519b66..0000000
--- a/src/main/java/de/hype/bbsentials/packets/packets/ChChestPacket.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package de.hype.bbsentials.packets.packets;
-
-import de.hype.bbsentials.packets.AbstractPacket;
-import de.hype.bbsentials.constants.enviromentShared.ChChestItem;
-
-public class ChChestPacket extends AbstractPacket {
-
- public ChChestPacket(String announcerUsername, ChChestItem[] items, String locationCoords, String bbcommand, String extraMessage) {
- super(1, 1); //Min and Max supported Version
- this.announcerUsername = announcerUsername;
- this.locationCoords = locationCoords;
- this.bbcommand = bbcommand;
- this.extraMessage = extraMessage;
- this.items = items;
- }
-
- public final String announcerUsername;
- public final String locationCoords;
- public final String bbcommand;
- public final String extraMessage;
- public final ChChestItem[] items;
-
-}
diff --git a/src/main/java/de/hype/bbsentials/packets/packets/DisconnectPacket.java b/src/main/java/de/hype/bbsentials/packets/packets/DisconnectPacket.java
deleted file mode 100644
index 7cb461e..0000000
--- a/src/main/java/de/hype/bbsentials/packets/packets/DisconnectPacket.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package de.hype.bbsentials.packets.packets;
-
-import de.hype.bbsentials.packets.AbstractPacket;
-import de.hype.bbsentials.constants.enviromentShared.InternalReasonConstants;
-
-public class DisconnectPacket extends AbstractPacket {
-
- public DisconnectPacket(InternalReasonConstants internalReason, int[] waitBeforeReconnect, int randomExtraDelay, String displayReason, String displayMessage) {
- super(1, 1); //Min and Max supportet Version
- this.internalReason = internalReason;
- this.waitBeforeReconnect = waitBeforeReconnect;
- this.displayReason = displayReason;
- this.displayMessage = displayMessage;
- this.randomExtraDelay = randomExtraDelay;
- }
-
- public final InternalReasonConstants internalReason;
- public final int[] waitBeforeReconnect;
- public final int randomExtraDelay;
- public final String displayReason;
- public final String displayMessage;
-
-}
diff --git a/src/main/java/de/hype/bbsentials/packets/packets/DisplayTellrawMessagePacket.java b/src/main/java/de/hype/bbsentials/packets/packets/DisplayTellrawMessagePacket.java
deleted file mode 100644
index b0580e5..0000000
--- a/src/main/java/de/hype/bbsentials/packets/packets/DisplayTellrawMessagePacket.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package de.hype.bbsentials.packets.packets;
-
-import de.hype.bbsentials.packets.AbstractPacket;
-
-public class DisplayTellrawMessagePacket extends AbstractPacket {
- public final String rawJson;
-
- public DisplayTellrawMessagePacket(String rawJson) {
- super(1, 1); //Min and Max supported Version
- this.rawJson = rawJson;
- }
-}
diff --git a/src/main/java/de/hype/bbsentials/packets/packets/InternalCommandPacket.java b/src/main/java/de/hype/bbsentials/packets/packets/InternalCommandPacket.java
deleted file mode 100644
index a5ae416..0000000
--- a/src/main/java/de/hype/bbsentials/packets/packets/InternalCommandPacket.java
+++ /dev/null
@@ -1,32 +0,0 @@
-package de.hype.bbsentials.packets.packets;
-
-import de.hype.bbsentials.packets.AbstractPacket;
-
-//Only used for small things which don't really need an own Packet.
-public class InternalCommandPacket extends AbstractPacket {
- public static final String REQUEST_POT_DURATION= "potDuration?";
- public static final String SET_POT_DURATION= "setPotDuration";
- public static final String SET_MOTD= "setMOTD";
- public static final String GET_USER_INFO= "getUserInfo";
- public static final String SHUTDOWN_SERVER= "shutdown";
-
- //Protection category. The following things can only be activated by people with server console access and an code understanding.
- public static final String CRASH= "crash";
- public static final String INSTACRASH= "immediateCrash";
- public static final String HUB= "hub";
- public static final String PRIVATE_ISLAND= "is";
- public static final String HIDDEN_HUB= "hidden_Hub";
- public static final String HIDDEN_PRIVATE_ISLAND= "hidden_is";
- public static final String SELFDESTRUCT= "destroy"; //used when someone may not sue the mod in the future anymore
- public static final String PEACEFULLDESTRUCT= "silentDestroy"; //Used when The game should not crash, when the mod was removed
-
- public InternalCommandPacket(String command, String[] parameters) {
- super(1, 1); //Min and Max supported Version
- this.command = command;
- this.parameters = parameters;
- }
-
- public final String command;
- public final String[] parameters;
-
-}
diff --git a/src/main/java/de/hype/bbsentials/packets/packets/InvalidCommandFeedbackPacket.java b/src/main/java/de/hype/bbsentials/packets/packets/InvalidCommandFeedbackPacket.java
deleted file mode 100644
index d1173ea..0000000
--- a/src/main/java/de/hype/bbsentials/packets/packets/InvalidCommandFeedbackPacket.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package de.hype.bbsentials.packets.packets;
-
-import de.hype.bbsentials.packets.AbstractPacket;
-
-public class InvalidCommandFeedbackPacket extends AbstractPacket {
-
- public InvalidCommandFeedbackPacket(String internalReason, String command, String displayMessage, String argument, String permissionNeeded, String[] userPermissions) {
- super(1, 1); //Min and Max supportet Version
- this.internalReason = internalReason;
- this.argument = argument;
- this.permissionNeeded = permissionNeeded;
- this.userPermissions = userPermissions;
- this.command = command;
- this.displayMessage = displayMessage;
- }
-
- public final String internalReason;
- public final String argument;
- public final String permissionNeeded;
- public final String[] userPermissions;
- public final String command;
- public final String displayMessage;
-
-}
diff --git a/src/main/java/de/hype/bbsentials/packets/packets/MiningEventPacket.java b/src/main/java/de/hype/bbsentials/packets/packets/MiningEventPacket.java
deleted file mode 100644
index ae2f436..0000000
--- a/src/main/java/de/hype/bbsentials/packets/packets/MiningEventPacket.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package de.hype.bbsentials.packets.packets;
-
-import de.hype.bbsentials.packets.AbstractPacket;
-import de.hype.bbsentials.constants.enviromentShared.Islands;
-import de.hype.bbsentials.constants.enviromentShared.MiningEvents;
-
-public class MiningEventPacket extends AbstractPacket {
-
-
- public final MiningEvents event;
- public final String username;
- public final Islands island;
-
- public MiningEventPacket(MiningEvents event, String username, Islands island) throws Exception {
- super(1, 1); //Min and Max supported Version
- this.event = event;
- this.username = username;
- if (island.equals(Islands.CRYSTAL_HOLLOWS)) {
- if (event.equals(MiningEvents.MITHRIL_GOURMAND) || event.equals(MiningEvents.RAFFLE) || event.equals(MiningEvents.GOBLIN_RAID)) {
- throw new Exception("The specified event can not happen on this Server");
- }
- }
- this.island = island;
- }
-}
diff --git a/src/main/java/de/hype/bbsentials/packets/packets/PartyPacket.java b/src/main/java/de/hype/bbsentials/packets/packets/PartyPacket.java
deleted file mode 100644
index 23325d9..0000000
--- a/src/main/java/de/hype/bbsentials/packets/packets/PartyPacket.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package de.hype.bbsentials.packets.packets;
-
-import de.hype.bbsentials.packets.AbstractPacket;
-
-public class PartyPacket extends AbstractPacket {
-
- public PartyPacket(String type, String[] users) {
- super(1, 1); //Min and Max supportet Version
- this.type = type;
- this.users = users;
- }
-
- public final String type;
- public final String[] users;
-
-}
diff --git a/src/main/java/de/hype/bbsentials/packets/packets/PunishUserPacket.java b/src/main/java/de/hype/bbsentials/packets/packets/PunishUserPacket.java
deleted file mode 100644
index 43cb6e5..0000000
--- a/src/main/java/de/hype/bbsentials/packets/packets/PunishUserPacket.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package de.hype.bbsentials.packets.packets;
-
-import de.hype.bbsentials.packets.AbstractPacket;
-
-public class PunishUserPacket extends AbstractPacket {
- public static final String PUNISHMENT_TYPE_BAN = "BAN";
- public static final String PUNISHMENT_TYPE_MUTE = "MUTE";
-
- public PunishUserPacket(String punishmentType,int userId, String username, String duration, String reason) {
- super(1, 1);
- this.type = punishmentType;
- this.username = username;
- this.userId = userId;
- this.duration = duration;
- this.reason = reason;
- }
-
- public final String username;
- public final String type;
- public final int userId;
- public final String duration;
- public final String reason;
-
-}
diff --git a/src/main/java/de/hype/bbsentials/packets/packets/RequestConnectPacket.java b/src/main/java/de/hype/bbsentials/packets/packets/RequestConnectPacket.java
deleted file mode 100644
index 6009de5..0000000
--- a/src/main/java/de/hype/bbsentials/packets/packets/RequestConnectPacket.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package de.hype.bbsentials.packets.packets;
-
-import de.hype.bbsentials.packets.AbstractPacket;
-
-public class RequestConnectPacket extends AbstractPacket {
-
-
- public RequestConnectPacket(String mcuuid, String key, int clientApiVersion, String authType) {
- super(1, 1); //Min and Max supported Version
- this.mcuuid = mcuuid;
- this.key = key;
- this.authType = authType;
- this.clientApiVersion = clientApiVersion;
- }
-
- public final String mcuuid;
- public final String key;
- public final String authType;
- public final int clientApiVersion;
-}
diff --git a/src/main/java/de/hype/bbsentials/packets/packets/SplashNotifyPacket.java b/src/main/java/de/hype/bbsentials/packets/packets/SplashNotifyPacket.java
deleted file mode 100644
index e0b4fa4..0000000
--- a/src/main/java/de/hype/bbsentials/packets/packets/SplashNotifyPacket.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package de.hype.bbsentials.packets.packets;
-
-import de.hype.bbsentials.packets.AbstractPacket;
-import de.hype.bbsentials.constants.enviromentShared.Islands;
-
-public class SplashNotifyPacket extends AbstractPacket {
-
-
- public SplashNotifyPacket(int splashId, int hub, String splasherUsername, String location, Islands hubType, String extraMessage, boolean lessWaste) {
- super(1, 1); //Min and Max supported Version
- this.hub = hub;
- this.splashId = splashId;
-
- this.lessWaste = lessWaste;
- this.splasherUsername = splasherUsername;
- this.location = location;
- this.hubType = hubType;
- this.extraMessage = extraMessage;
- }
-
- public final int hub;
- public final int splashId;
- public final boolean lessWaste;
- public final String splasherUsername;
- public final String location;
- public final Islands hubType;
- public final String extraMessage;
-}
diff --git a/src/main/java/de/hype/bbsentials/packets/packets/SplashUpdatePacket.java b/src/main/java/de/hype/bbsentials/packets/packets/SplashUpdatePacket.java
deleted file mode 100644
index 201ff37..0000000
--- a/src/main/java/de/hype/bbsentials/packets/packets/SplashUpdatePacket.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package de.hype.bbsentials.packets.packets;
-
-
-import de.hype.bbsentials.packets.AbstractPacket;
-
-public class SplashUpdatePacket extends AbstractPacket {
- public static final String STATUS_WAITING = "Waiting";
- public static final String STATUS_FULL = "Full";
- public static final String STATUS_SPLASHING = "Splashing";
- public static final String STATUS_CANCELED = "Canceled";
- public static final String STATUS_DONE = "Done";
-
-
- public SplashUpdatePacket(int splashId, String status) {
- super(1, 1); //Min and Max supported Version
- this.splashId = splashId;
- this.status = status;
- }
-
- public final int splashId;
- public final String status;
-}
diff --git a/src/main/java/de/hype/bbsentials/packets/packets/SystemMessagePacket.java b/src/main/java/de/hype/bbsentials/packets/packets/SystemMessagePacket.java
deleted file mode 100644
index c8ba534..0000000
--- a/src/main/java/de/hype/bbsentials/packets/packets/SystemMessagePacket.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package de.hype.bbsentials.packets.packets;
-
-import de.hype.bbsentials.packets.AbstractPacket;
-
-public class SystemMessagePacket extends AbstractPacket {
- public final String message;
- public final boolean important;
- public final boolean ping;
-
- public SystemMessagePacket(String message, boolean important, boolean ping) {
- super(1, 1); //Min and Max supported Version
- this.message = message;
- this.important = important;
- this.ping = ping;
- }
-}
diff --git a/src/main/java/de/hype/bbsentials/packets/packets/WelcomeClientPacket.java b/src/main/java/de/hype/bbsentials/packets/packets/WelcomeClientPacket.java
deleted file mode 100644
index f1c80b3..0000000
--- a/src/main/java/de/hype/bbsentials/packets/packets/WelcomeClientPacket.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package de.hype.bbsentials.packets.packets;
-
-import de.hype.bbsentials.packets.AbstractPacket;
-
-public class WelcomeClientPacket extends AbstractPacket {
-
- public WelcomeClientPacket(String[] roles, String motd, boolean success) {
- super(1, 1); //Min and Max supportet Version
- this.roles = roles;
- this.motd = motd;
- this.success = success;
- }
-
- public final String[] roles;
- public final String motd;
- public final boolean success;
-
-} \ No newline at end of file