From 6e588a89526089244696849f34083551913f96c9 Mon Sep 17 00:00:00 2001 From: Kath <55346310+Kathund@users.noreply.github.com> Date: Fri, 19 Jul 2024 02:18:14 +0800 Subject: [PATCH 1/4] Remove /limbo (#98) --- .../org/polyfrost/hytils/HytilsReborn.java | 1 - .../hytils/command/LimboCommand.java | 38 ------------------- .../mixin/CommandLimboMixin_FixCommand.java | 35 ----------------- src/main/resources/mixins.hytils.json | 1 - 4 files changed, 75 deletions(-) delete mode 100644 src/main/java/org/polyfrost/hytils/command/LimboCommand.java delete mode 100644 src/main/java/org/polyfrost/hytils/mixin/CommandLimboMixin_FixCommand.java diff --git a/src/main/java/org/polyfrost/hytils/HytilsReborn.java b/src/main/java/org/polyfrost/hytils/HytilsReborn.java index a0f98f1..a393fd4 100644 --- a/src/main/java/org/polyfrost/hytils/HytilsReborn.java +++ b/src/main/java/org/polyfrost/hytils/HytilsReborn.java @@ -109,7 +109,6 @@ public void init(FMLInitializationEvent event) { CommandManager.INSTANCE.registerCommand(new HousingVisitCommand()); CommandManager.INSTANCE.registerCommand(new HytilsCommand()); CommandManager.INSTANCE.registerCommand(new IgnoreTemporaryCommand()); - CommandManager.INSTANCE.registerCommand(new LimboCommand()); CommandManager.INSTANCE.registerCommand(new RequeueCommand()); CommandManager.INSTANCE.registerCommand(new SilentRemoveCommand()); CommandManager.INSTANCE.registerCommand(new SkyblockVisitCommand()); diff --git a/src/main/java/org/polyfrost/hytils/command/LimboCommand.java b/src/main/java/org/polyfrost/hytils/command/LimboCommand.java deleted file mode 100644 index add90c0..0000000 --- a/src/main/java/org/polyfrost/hytils/command/LimboCommand.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Hytils Reborn - Hypixel focused Quality of Life mod. - * Copyright (C) 2020, 2021, 2022, 2023 Polyfrost, Sk1er LLC and contributors - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package org.polyfrost.hytils.command; - -import cc.polyfrost.oneconfig.libs.universal.ChatColor; -import cc.polyfrost.oneconfig.libs.universal.UChat; -import cc.polyfrost.oneconfig.utils.commands.annotations.Command; -import cc.polyfrost.oneconfig.utils.commands.annotations.Main; -import cc.polyfrost.oneconfig.utils.hypixel.HypixelUtils; -import net.minecraft.client.Minecraft; - -@Command("limbo") -public class LimboCommand { - @Main(description = "Sends you to limbo.") - private void main() { - if (HypixelUtils.INSTANCE.isHypixel()) { - Minecraft.getMinecraft().thePlayer.sendChatMessage("§"); - } else { - UChat.chat(ChatColor.RED + "You must be on Hypixel to use this command."); - } - } -} diff --git a/src/main/java/org/polyfrost/hytils/mixin/CommandLimboMixin_FixCommand.java b/src/main/java/org/polyfrost/hytils/mixin/CommandLimboMixin_FixCommand.java deleted file mode 100644 index fee3236..0000000 --- a/src/main/java/org/polyfrost/hytils/mixin/CommandLimboMixin_FixCommand.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Hytils Reborn - Hypixel focused Quality of Life mod. - * Copyright (C) 2020, 2021, 2022, 2023 Polyfrost, Sk1er LLC and contributors - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package org.polyfrost.hytils.mixin; - -import org.spongepowered.asm.mixin.Dynamic; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Pseudo; -import org.spongepowered.asm.mixin.injection.Constant; -import org.spongepowered.asm.mixin.injection.ModifyConstant; - -@Pseudo -@Mixin(targets = "me.semx11.autotip.command.impl.CommandLimbo", remap = false) -public class CommandLimboMixin_FixCommand { - @Dynamic("AutoTip") - @ModifyConstant(method = "onCommand", constant = @Constant(stringValue = "/achat \u00a7c")) - private String hytils$fixAutotipCommand(String value) { - return "§"; - } -} diff --git a/src/main/resources/mixins.hytils.json b/src/main/resources/mixins.hytils.json index 4ebb3cc..c181d6f 100644 --- a/src/main/resources/mixins.hytils.json +++ b/src/main/resources/mixins.hytils.json @@ -7,7 +7,6 @@ "verbose": true, "client": [ "BossStatusMixin_HideBossbar", - "CommandLimboMixin_FixCommand", "EntityLivingBaseMixin_MiningFatigue", "EntityPlayerSPMixin_MessageHandling", "GuiChatMixin_PlayAutocomplete", From 7efbac1446e810976427fb7e90da07ca069064cb Mon Sep 17 00:00:00 2001 From: MicrocontrollersDev Date: Thu, 18 Jul 2024 18:34:30 -0700 Subject: [PATCH 2/4] fix false config dependencies --- src/main/java/org/polyfrost/hytils/config/HytilsConfig.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/main/java/org/polyfrost/hytils/config/HytilsConfig.java b/src/main/java/org/polyfrost/hytils/config/HytilsConfig.java index 4715313..4645c5d 100644 --- a/src/main/java/org/polyfrost/hytils/config/HytilsConfig.java +++ b/src/main/java/org/polyfrost/hytils/config/HytilsConfig.java @@ -1453,10 +1453,6 @@ public HytilsConfig() { if (!cleanerGameStartAnnouncements) GameStartCompactor.lastMessage = null; }); - addDependency("playerCountBeforePlayerName", "gameStatusRestyle"); - addDependency("playerCountOnPlayerLeave", "gameStatusRestyle"); - addDependency("padPlayerCount", "gameStatusRestyle"); - addDependency("blockNumber", "blockNotify"); addDependency("blockNotifySound", "blockNotify"); addDependency("blockNotifySound", "blockNotify"); From 9ff12e8240c2391f408818ffe4ff17814ad5a1ab Mon Sep 17 00:00:00 2001 From: Zickles <76439587+Zickles@users.noreply.github.com> Date: Fri, 19 Jul 2024 15:15:21 -0400 Subject: [PATCH 3/4] feat PM short channel name (#99) --- .../org/polyfrost/hytils/config/HytilsConfig.java | 7 +++++++ .../chat/modules/modifiers/DefaultChatRestyler.java | 12 ++++++++++++ .../hytils/handlers/language/LanguageData.java | 6 ++++++ 3 files changed, 25 insertions(+) diff --git a/src/main/java/org/polyfrost/hytils/config/HytilsConfig.java b/src/main/java/org/polyfrost/hytils/config/HytilsConfig.java index 4645c5d..9f53e4a 100644 --- a/src/main/java/org/polyfrost/hytils/config/HytilsConfig.java +++ b/src/main/java/org/polyfrost/hytils/config/HytilsConfig.java @@ -321,6 +321,13 @@ public class HytilsConfig extends Config { ) public static boolean shortChannelNames; + @Switch( + name = "Short Private Message Channel Names", + description = "Abbreviate private message channel names.\n§eExample: §dTo and §dFrom §e-> PM", + category = "Chat", subcategory = "Visual" + ) + public static boolean pmShortChannelNames; + @Switch( name = "Party Chat Swapper", description = "Automatically change to and out of a party channel when joining/leaving a party.", diff --git a/src/main/java/org/polyfrost/hytils/handlers/chat/modules/modifiers/DefaultChatRestyler.java b/src/main/java/org/polyfrost/hytils/handlers/chat/modules/modifiers/DefaultChatRestyler.java index 08f7438..c3536df 100644 --- a/src/main/java/org/polyfrost/hytils/handlers/chat/modules/modifiers/DefaultChatRestyler.java +++ b/src/main/java/org/polyfrost/hytils/handlers/chat/modules/modifiers/DefaultChatRestyler.java @@ -97,6 +97,18 @@ public void onMessageReceived(@NotNull ClientChatReceivedEvent event) { } } + if (HytilsConfig.pmShortChannelNames) { + Matcher privateMessageToMatcher = language.chatRestylerPrivateMessageToPatternRegex.matcher(message); + Matcher privateMessageFromMatcher = language.chatRestylerPrivateMessageFromPatternRegex.matcher(message); + if (privateMessageToMatcher.find()) { + event.message = shortenChannelName(event.message, language.chatRestylerPrivateMessageToPatternRegex.pattern(), + "§d" + "PM >", true); + } else if (privateMessageFromMatcher.find()) { + event.message = shortenChannelName(event.message, language.chatRestylerPrivateMessageFromPatternRegex.pattern(), + "§5" + "PM <", true); + } + } + if (HytilsConfig.coloredStatuses) { Matcher statusMatcher = getLanguage().chatRestylerStatusPatternRegex.matcher(event.message.getFormattedText().trim()); if (statusMatcher.matches()) { diff --git a/src/main/java/org/polyfrost/hytils/handlers/language/LanguageData.java b/src/main/java/org/polyfrost/hytils/handlers/language/LanguageData.java index c15501b..c3be347 100644 --- a/src/main/java/org/polyfrost/hytils/handlers/language/LanguageData.java +++ b/src/main/java/org/polyfrost/hytils/handlers/language/LanguageData.java @@ -80,6 +80,8 @@ public class LanguageData { private String chatRestylerFriendPattern = "^((?:\u00a7r)?\u00a7\\w)(Friend >)"; private String chatRestylerOfficerPattern = "^((?:\u00a7r)?\u00a7\\w)(Officer >)"; private String chatRestylerStatusPattern = "^(?(?:\u00a7aFriend|\u00a7a\u00a7aF|\u00a72Guild|\u00a72\u00a72G)) > (\u00a7r|\u00a7r\u00a7r){1,2}(?\u00a7[\\da-f]\\w{1,16}) \u00a7r\u00a7e(?(?:joined|left))\\.\u00a7r$"; + private String chatRestylerPrivateMessageToPattern = "^((?:\u00a7r)?\u00a7\\w)(To)"; + private String chatRestylerPrivateMessageFromPattern = "^((?:\u00a7r)?\u00a7\\w)(From)"; private String autoChatSwapperPartyStatus = "^(?:You have been kicked from the party by (?:\\[.+] )?\\w{1,16}|(?:\\[.+] )?\\w{1,16} has disbanded the party!|You left the party.)$"; private String autoChatSwapperPartyStatus2 = "^(?:You have joined (?:\\[.+] )?(?:.*)|Party Members(?:\\[.+] )?\\w{1,100}|(?:\\[.+] )?\\w{1,100} joined the(?:.*) party(?:.*))$"; @@ -157,6 +159,8 @@ public class LanguageData { public Pattern chatRestylerFriendPatternRegex; public Pattern chatRestylerOfficerPatternRegex; public Pattern chatRestylerStatusPatternRegex; + public Pattern chatRestylerPrivateMessageToPatternRegex; + public Pattern chatRestylerPrivateMessageFromPatternRegex; public Pattern autoChatSwapperPartyStatusRegex; public Pattern autoChatSwapperPartyStatusRegex2; @@ -223,6 +227,8 @@ public void initialize() { chatRestylerFriendPatternRegex = Pattern.compile(chatRestylerFriendPattern); chatRestylerOfficerPatternRegex = Pattern.compile(chatRestylerOfficerPattern); chatRestylerStatusPatternRegex = Pattern.compile(chatRestylerStatusPattern); + chatRestylerPrivateMessageToPatternRegex = Pattern.compile(chatRestylerPrivateMessageToPattern); + chatRestylerPrivateMessageFromPatternRegex = Pattern.compile(chatRestylerPrivateMessageFromPattern); autoChatSwapperPartyStatusRegex = Pattern.compile(autoChatSwapperPartyStatus); autoChatSwapperPartyStatusRegex2 = Pattern.compile(autoChatSwapperPartyStatus2); From c60c56a02530cca6f626498f962ba00a0d905ccf Mon Sep 17 00:00:00 2001 From: ev chang Date: Sat, 20 Jul 2024 04:21:23 +0900 Subject: [PATCH 4/4] bump PGT and ver --- gradle.properties | 2 +- settings.gradle.kts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index 8314fcc..05e3920 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ mod_name = Hytils Reborn mod_id = hytils-reborn -mod_version = 1.7.1 +mod_version = 1.7.2-alpha.1 # Sets the name of the jar file that you put in your 'mods' folder. mod_archives_name=Hytils Reborn diff --git a/settings.gradle.kts b/settings.gradle.kts index 0195299..e751a97 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -7,7 +7,7 @@ pluginManagement { maven("https://repo.polyfrost.org/releases") // Adds the Polyfrost maven repository to get Polyfrost Gradle Toolkit } plugins { - val pgtVersion = "0.6.2" // Sets the default versions for Polyfrost Gradle Toolkit + val pgtVersion = "0.6.5" // Sets the default versions for Polyfrost Gradle Toolkit id("org.polyfrost.multi-version.root") version pgtVersion } }