diff options
-rw-r--r-- | common/src/main/java/de/hype/bbsentials/common/chat/Chat.java | 202 | ||||
-rw-r--r-- | common/src/main/java/de/hype/bbsentials/common/client/Config.java | 1 | ||||
-rw-r--r-- | runforge/.mixin.out/audit/mixin_implementation_report.txt | 2 | ||||
-rw-r--r-- | runforge/.mixin.out/class/net/minecraft/client/renderer/entity/RenderItem.class | bin | 48096 -> 48096 bytes | |||
-rw-r--r-- | runforge/config/splash.properties | 2 |
5 files changed, 107 insertions, 100 deletions
diff --git a/common/src/main/java/de/hype/bbsentials/common/chat/Chat.java b/common/src/main/java/de/hype/bbsentials/common/chat/Chat.java index 487abe2..b11804a 100644 --- a/common/src/main/java/de/hype/bbsentials/common/chat/Chat.java +++ b/common/src/main/java/de/hype/bbsentials/common/chat/Chat.java @@ -24,6 +24,11 @@ import java.util.regex.Pattern; public class Chat { + //{"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 static String[] getVariableInfo(String packageName, String className) { List<String> variableInfoList = new ArrayList<>(); @@ -115,6 +120,96 @@ public class Chat { sendPrivateMessageToSelfSuccess("The variable " + field.getName() + " is: " + field.get(object)); } + 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) { + EnvironmentCore.chat.sendClientSideMessage(Message.of(message)); + } + + public static void sendPrivateMessageToSelfText(Message message) { + EnvironmentCore.chat.sendClientSideMessage(message); + } + + public static void sendCommand(String s) { + BBsentials.getConfig().sender.addSendTask(s); + } + + 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 (BBsentials.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"; + BBsentials.getConfig().setLastChatPromptAnswer(promptCommand); + if (BBsentials.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(); + + } + } + public Message onEvent(Message text) { if (!isSpam(text.getString())) { if (BBsentials.getConfig().isDetailedDevModeEnabled()) { @@ -229,11 +324,13 @@ public class Chat { } 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;} + for (String users : messageUnformatted.replace("You'll be partying with:", "").replaceAll("\\[[^\\]]*\\]", "").trim().split(",")) { + if (users.contains("and ")) { + break; + } members.add(users); } - Config.partyMembers=members; + Config.partyMembers = members; } else if (((messageUnformatted.startsWith("Party Leader: ") && messageUnformatted.endsWith(BBsentials.getConfig().getUsername() + " ●"))) || (message.contains(BBsentials.getConfig().getUsername() + " warped the party to a SkyBlock dungeon!")) || message.startsWith("The party was transferred to " + BBsentials.getConfig().getUsername()) || message.getUnformattedString().endsWith(" has promoted " + BBsentials.getConfig().getUsername() + " to Party Leader") || (message.contains("warped to your dungeon"))) { BBsentials.getConfig().setIsLeader(true); @@ -272,14 +369,8 @@ public class Chat { } } - //{"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==null) return true; + if (message == null) return true; if (message.isEmpty()) return true; if (message.contains("Mana")) return true; if (message.contains("Status")) return true; @@ -293,43 +384,11 @@ public class Chat { 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) { - EnvironmentCore.chat.sendClientSideMessage(Message.of(message)); - } - - public static void sendPrivateMessageToSelfText(Message message) { - EnvironmentCore.chat.sendClientSideMessage(message); - } - - public static void sendCommand(String s) { - BBsentials.getConfig().sender.addSendTask(s); + public void sendNotification(String title, String text) { + sendNotification(title, text,1); } - public void sendNotification(String title, String text) { + public void sendNotification(String title, String text, float volume) { BBsentials.executionService.execute(() -> { try { InputStream inputStream = getClass().getResourceAsStream("/sounds/mixkit-sci-fi-confirmation-914.wav"); @@ -362,57 +421,4 @@ public class Chat { e.printStackTrace(); } } - 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 (BBsentials.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"; - BBsentials.getConfig().setLastChatPromptAnswer(promptCommand); - if (BBsentials.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(); - - } - } } diff --git a/common/src/main/java/de/hype/bbsentials/common/client/Config.java b/common/src/main/java/de/hype/bbsentials/common/client/Config.java index a23fe62..455df36 100644 --- a/common/src/main/java/de/hype/bbsentials/common/client/Config.java +++ b/common/src/main/java/de/hype/bbsentials/common/client/Config.java @@ -97,6 +97,7 @@ public class Config implements Serializable { settings.username = EnvironmentCore.mcUtils.getUsername(); } if (!settings.hasBBRoles("dev")) { + //Changing disallowed. doing will result in a permanent ban! settings.detailedDevMode = false; settings.devMode = false; } diff --git a/runforge/.mixin.out/audit/mixin_implementation_report.txt b/runforge/.mixin.out/audit/mixin_implementation_report.txt index f6eb4dc..b680a1c 100644 --- a/runforge/.mixin.out/audit/mixin_implementation_report.txt +++ b/runforge/.mixin.out/audit/mixin_implementation_report.txt @@ -1 +1 @@ -Mixin Implementation Report generated on 2023-10-14 16:14:19 +Mixin Implementation Report generated on 2023-10-14 17:27:21 diff --git a/runforge/.mixin.out/class/net/minecraft/client/renderer/entity/RenderItem.class b/runforge/.mixin.out/class/net/minecraft/client/renderer/entity/RenderItem.class Binary files differindex edb1ccd..09f2b0c 100644 --- a/runforge/.mixin.out/class/net/minecraft/client/renderer/entity/RenderItem.class +++ b/runforge/.mixin.out/class/net/minecraft/client/renderer/entity/RenderItem.class diff --git a/runforge/config/splash.properties b/runforge/config/splash.properties index 12e15ca..f765858 100644 --- a/runforge/config/splash.properties +++ b/runforge/config/splash.properties @@ -1,5 +1,5 @@ #Splash screen properties -#Sat Oct 14 16:14:22 CEST 2023 +#Sat Oct 14 17:27:24 CEST 2023 logoTexture=textures/gui/title/mojang.png background=0xFFFFFF font=0x0 |