aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWyvest <45589059+Wyvest@users.noreply.github.com>2022-01-01 22:11:34 +0700
committerWyvest <45589059+Wyvest@users.noreply.github.com>2022-01-01 22:11:34 +0700
commitcc4a11c7943d9036dc71679eaa531832cd2a2f0c (patch)
treeda242580d43fa6f26f0b0b04deab82c200a5bb16
parent856df4d08d3c392b35f256966f6263da86fdb7ab (diff)
downloadChatting-cc4a11c7943d9036dc71679eaa531832cd2a2f0c.tar.gz
Chatting-cc4a11c7943d9036dc71679eaa531832cd2a2f0c.tar.bz2
Chatting-cc4a11c7943d9036dc71679eaa531832cd2a2f0c.zip
Chattils 1.0.0
-rw-r--r--build.gradle4
-rw-r--r--gradle.properties6
-rw-r--r--src/main/java/cc/woverflow/chattils/hook/GuiNewChatHook.java (renamed from src/main/java/com/raeids/stratus/hook/GuiNewChatHook.java)4
-rw-r--r--src/main/java/cc/woverflow/chattils/mixin/ClientCommandHandlerMixin.java (renamed from src/main/java/com/raeids/stratus/mixin/ClientCommandHandlerMixin.java)9
-rw-r--r--src/main/java/cc/woverflow/chattils/mixin/EntityPlayerSPMixin.java (renamed from src/main/java/com/raeids/stratus/mixin/EntityPlayerSPMixin.java)8
-rw-r--r--src/main/java/cc/woverflow/chattils/mixin/GuiChatMixin.java (renamed from src/main/java/com/raeids/stratus/mixin/GuiChatMixin.java)29
-rw-r--r--src/main/java/cc/woverflow/chattils/mixin/GuiNewChatAccessor.java (renamed from src/main/java/com/raeids/stratus/mixin/GuiNewChatAccessor.java)2
-rw-r--r--src/main/java/cc/woverflow/chattils/mixin/GuiNewChatMapMixin.java (renamed from src/main/java/com/raeids/stratus/mixin/GuiNewChatMapMixin.java)8
-rw-r--r--src/main/java/cc/woverflow/chattils/mixin/GuiNewChatMixin.java (renamed from src/main/java/com/raeids/stratus/mixin/GuiNewChatMixin.java)74
-rw-r--r--src/main/java/cc/woverflow/chattils/mixin/WyvtilsListenerMixin.java (renamed from src/main/java/com/raeids/stratus/mixin/WyvtilsListenerMixin.java)6
-rw-r--r--src/main/kotlin/cc/woverflow/chattils/Chattils.kt (renamed from src/main/kotlin/com/raeids/stratus/Stratus.kt)48
-rw-r--r--src/main/kotlin/cc/woverflow/chattils/chat/ChatRegexes.kt (renamed from src/main/kotlin/com/raeids/stratus/chat/ChatRegexes.kt)2
-rw-r--r--src/main/kotlin/cc/woverflow/chattils/chat/ChatSearchingManager.kt (renamed from src/main/kotlin/com/raeids/stratus/chat/ChatSearchingManager.kt)4
-rw-r--r--src/main/kotlin/cc/woverflow/chattils/chat/ChatShortcuts.kt (renamed from src/main/kotlin/com/raeids/stratus/chat/ChatShortcuts.kt)14
-rw-r--r--src/main/kotlin/cc/woverflow/chattils/chat/ChatTab.kt (renamed from src/main/kotlin/com/raeids/stratus/chat/ChatTab.kt)4
-rw-r--r--src/main/kotlin/cc/woverflow/chattils/chat/ChatTabs.kt (renamed from src/main/kotlin/com/raeids/stratus/chat/ChatTabs.kt)6
-rw-r--r--src/main/kotlin/cc/woverflow/chattils/chat/ChatTabsJson.kt (renamed from src/main/kotlin/com/raeids/stratus/chat/ChatTabsJson.kt)2
-rw-r--r--src/main/kotlin/cc/woverflow/chattils/command/ChattilsCommand.kt15
-rw-r--r--src/main/kotlin/cc/woverflow/chattils/config/ChattilsConfig.kt (renamed from src/main/kotlin/com/raeids/stratus/config/StratusConfig.kt)22
-rw-r--r--src/main/kotlin/cc/woverflow/chattils/gui/ChatShortcutEditGui.kt (renamed from src/main/kotlin/com/raeids/stratus/gui/ChatShortcutEditGui.kt)4
-rw-r--r--src/main/kotlin/cc/woverflow/chattils/gui/ChatShortcutViewGui.kt (renamed from src/main/kotlin/com/raeids/stratus/gui/ChatShortcutViewGui.kt)6
-rw-r--r--src/main/kotlin/cc/woverflow/chattils/gui/components/CleanButton.kt (renamed from src/main/kotlin/com/raeids/stratus/gui/components/CleanButton.kt)6
-rw-r--r--src/main/kotlin/cc/woverflow/chattils/gui/components/ScreenshotButton.kt (renamed from src/main/kotlin/com/raeids/stratus/gui/components/ScreenshotButton.kt)10
-rw-r--r--src/main/kotlin/cc/woverflow/chattils/gui/components/SearchButton.kt (renamed from src/main/kotlin/com/raeids/stratus/gui/components/SearchButton.kt)8
-rw-r--r--src/main/kotlin/cc/woverflow/chattils/gui/components/TabButton.kt (renamed from src/main/kotlin/com/raeids/stratus/gui/components/TabButton.kt)6
-rw-r--r--src/main/kotlin/cc/woverflow/chattils/gui/components/TextBlock.kt (renamed from src/main/kotlin/com/raeids/stratus/gui/components/TextBlock.kt)2
-rw-r--r--src/main/kotlin/cc/woverflow/chattils/updater/DownloadGui.kt (renamed from src/main/kotlin/com/raeids/stratus/updater/DownloadGui.kt)14
-rw-r--r--src/main/kotlin/cc/woverflow/chattils/updater/Updater.kt (renamed from src/main/kotlin/com/raeids/stratus/updater/Updater.kt)26
-rw-r--r--src/main/kotlin/cc/woverflow/chattils/utils/ImageTransferable.kt (renamed from src/main/kotlin/com/raeids/stratus/utils/ImageTransferable.kt)2
-rw-r--r--src/main/kotlin/cc/woverflow/chattils/utils/ListenableArrayList.kt9
-rw-r--r--src/main/kotlin/cc/woverflow/chattils/utils/ModCompatHooks.kt (renamed from src/main/kotlin/com/raeids/stratus/utils/ModCompatHooks.kt)10
-rw-r--r--src/main/kotlin/cc/woverflow/chattils/utils/RenderHelper.kt (renamed from src/main/kotlin/com/raeids/stratus/utils/RenderHelper.kt)8
-rw-r--r--src/main/kotlin/com/raeids/stratus/command/StratusCommand.kt15
-rw-r--r--src/main/resources/assets/chattils/copy.png (renamed from src/main/resources/assets/stratus/copy.png)bin641 -> 641 bytes
-rw-r--r--src/main/resources/assets/chattils/screenshot.png (renamed from src/main/resources/assets/stratus/screenshot.png)bin162 -> 162 bytes
-rw-r--r--src/main/resources/assets/chattils/search.png (renamed from src/main/resources/assets/stratus/search.png)bin158 -> 158 bytes
-rw-r--r--src/main/resources/mcmod.info2
-rw-r--r--src/main/resources/mixins.chattils.json (renamed from src/main/resources/mixins.stratus.json)2
38 files changed, 208 insertions, 189 deletions
diff --git a/build.gradle b/build.gradle
index 60ab0a8..07a6a66 100644
--- a/build.gradle
+++ b/build.gradle
@@ -8,11 +8,11 @@ plugins {
}
version = mod_version
-group = "com.raeids"
+group = "cc.woverflow"
archivesBaseName = mod_name
blossom {
- String className = "src/main/kotlin/com/raeids/stratus/Stratus.kt"
+ String className = "src/main/kotlin/cc/woverflow/chattils/Chattils.kt"
replaceToken("@VER@", project.version, className)
replaceToken("@NAME@", mod_name, className)
replaceToken("@ID@", mod_id, className)
diff --git a/gradle.properties b/gradle.properties
index 0e029c7..4736025 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -1,4 +1,4 @@
org.gradle.jvmargs=-Xmx2G
-mod_name = Stratus
-mod_id = stratus
-mod_version = 0.1.0-beta2 \ No newline at end of file
+mod_name = Chattils
+mod_id = chattils
+mod_version = 1.0.0 \ No newline at end of file
diff --git a/src/main/java/com/raeids/stratus/hook/GuiNewChatHook.java b/src/main/java/cc/woverflow/chattils/hook/GuiNewChatHook.java
index 67552c4..f84fd43 100644
--- a/src/main/java/com/raeids/stratus/hook/GuiNewChatHook.java
+++ b/src/main/java/cc/woverflow/chattils/hook/GuiNewChatHook.java
@@ -1,4 +1,4 @@
-package com.raeids.stratus.hook;
+package cc.woverflow.chattils.hook;
import net.minecraft.client.gui.ChatLine;
@@ -9,7 +9,7 @@ public interface GuiNewChatHook {
boolean shouldCopy();
- Transferable getStratusChatComponent(int mouseY);
+ Transferable getChattilsChatComponent(int mouseY);
default ChatLine getFullMessage(ChatLine line) {
throw new AssertionError("getFullMessage not overridden on GuiNewChat");
diff --git a/src/main/java/com/raeids/stratus/mixin/ClientCommandHandlerMixin.java b/src/main/java/cc/woverflow/chattils/mixin/ClientCommandHandlerMixin.java
index ecdef69..0692342 100644
--- a/src/main/java/com/raeids/stratus/mixin/ClientCommandHandlerMixin.java
+++ b/src/main/java/cc/woverflow/chattils/mixin/ClientCommandHandlerMixin.java
@@ -1,7 +1,7 @@
-package com.raeids.stratus.mixin;
+package cc.woverflow.chattils.mixin;
-import com.raeids.stratus.config.StratusConfig;
-import com.raeids.stratus.chat.ChatShortcuts;
+import cc.woverflow.chattils.chat.ChatShortcuts;
+import cc.woverflow.chattils.config.ChattilsConfig;
import kotlin.Pair;
import net.minecraft.client.Minecraft;
import net.minecraft.command.CommandHandler;
@@ -13,6 +13,7 @@ import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
+import java.util.Iterator;
import java.util.List;
@Mixin(value = ClientCommandHandler.class, remap = false)
@@ -21,7 +22,7 @@ public class ClientCommandHandlerMixin extends CommandHandler {
private List<String> addChatShortcuts(ClientCommandHandler instance, ICommandSender iCommandSender, String leftOfCursor, BlockPos blockPos) {
Minecraft mc = FMLClientHandler.instance().getClient();
List<String> autocompleteList = instance.getTabCompletionOptions(mc.thePlayer, leftOfCursor, mc.thePlayer.getPosition());
- if (StratusConfig.INSTANCE.getChatShortcuts()) {
+ if (ChattilsConfig.INSTANCE.getChatShortcuts()) {
for (Pair<String, String> pair : ChatShortcuts.INSTANCE.getShortcuts()) {
if (pair.getFirst().startsWith(leftOfCursor)) {
autocompleteList.add(pair.getFirst());
diff --git a/src/main/java/com/raeids/stratus/mixin/EntityPlayerSPMixin.java b/src/main/java/cc/woverflow/chattils/mixin/EntityPlayerSPMixin.java
index c605511..48dfc10 100644
--- a/src/main/java/com/raeids/stratus/mixin/EntityPlayerSPMixin.java
+++ b/src/main/java/cc/woverflow/chattils/mixin/EntityPlayerSPMixin.java
@@ -1,7 +1,7 @@
-package com.raeids.stratus.mixin;
+package cc.woverflow.chattils.mixin;
-import com.raeids.stratus.config.StratusConfig;
-import com.raeids.stratus.chat.ChatTabs;
+import cc.woverflow.chattils.chat.ChatTabs;
+import cc.woverflow.chattils.config.ChattilsConfig;
import net.minecraft.client.entity.EntityPlayerSP;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
@@ -12,7 +12,7 @@ public class EntityPlayerSPMixin {
@ModifyVariable(method = "sendChatMessage", at = @At("HEAD"), ordinal = 0, argsOnly = true)
private String handleSentMessages(String value) {
if (value.startsWith("/")) return value;
- if (StratusConfig.INSTANCE.getChatTabs() && ChatTabs.INSTANCE.getCurrentTab() != null && !ChatTabs.INSTANCE.getCurrentTab().getPrefix().isEmpty()) {
+ if (ChattilsConfig.INSTANCE.getChatTabs() && ChatTabs.INSTANCE.getCurrentTab() != null && !ChatTabs.INSTANCE.getCurrentTab().getPrefix().isEmpty()) {
return ChatTabs.INSTANCE.getCurrentTab().getPrefix() + value;
} else {
return value;
diff --git a/src/main/java/com/raeids/stratus/mixin/GuiChatMixin.java b/src/main/java/cc/woverflow/chattils/mixin/GuiChatMixin.java
index bf0ac79..9af0204 100644
--- a/src/main/java/com/raeids/stratus/mixin/GuiChatMixin.java
+++ b/src/main/java/cc/woverflow/chattils/mixin/GuiChatMixin.java
@@ -1,12 +1,15 @@
-package com.raeids.stratus.mixin;
+package cc.woverflow.chattils.mixin;
+import cc.woverflow.chattils.chat.ChatSearchingManager;
+import cc.woverflow.chattils.chat.ChatShortcuts;
+import cc.woverflow.chattils.chat.ChatTab;
+import cc.woverflow.chattils.chat.ChatTabs;
+import cc.woverflow.chattils.config.ChattilsConfig;
+import cc.woverflow.chattils.gui.components.ScreenshotButton;
+import cc.woverflow.chattils.gui.components.SearchButton;
+import cc.woverflow.chattils.hook.GuiNewChatHook;
+import cc.woverflow.chattils.utils.ModCompatHooks;
import com.google.common.collect.Lists;
-import com.raeids.stratus.chat.*;
-import com.raeids.stratus.config.StratusConfig;
-import com.raeids.stratus.gui.components.ScreenshotButton;
-import com.raeids.stratus.gui.components.SearchButton;
-import com.raeids.stratus.hook.*;
-import com.raeids.stratus.utils.ModCompatHooks;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiChat;
import net.minecraft.client.gui.GuiScreen;
@@ -43,12 +46,12 @@ public abstract class GuiChatMixin extends GuiScreen {
@Inject(method = "initGui", at = @At("TAIL"))
private void init(CallbackInfo ci) {
- if (StratusConfig.INSTANCE.getChatSearch()) {
+ if (ChattilsConfig.INSTANCE.getChatSearch()) {
searchButton = new SearchButton();
buttonList.add(searchButton);
}
buttonList.add(new ScreenshotButton());
- if (StratusConfig.INSTANCE.getChatTabs()) {
+ if (ChattilsConfig.INSTANCE.getChatTabs()) {
for (ChatTab chatTab : ChatTabs.INSTANCE.getTabs()) {
buttonList.add(chatTab.getButton());
}
@@ -57,14 +60,14 @@ public abstract class GuiChatMixin extends GuiScreen {
@Inject(method = "updateScreen", at = @At("HEAD"))
private void updateScreen(CallbackInfo ci) {
- if (StratusConfig.INSTANCE.getChatSearch() && searchButton.isEnabled()) {
+ if (ChattilsConfig.INSTANCE.getChatSearch() && searchButton.isEnabled()) {
searchButton.getInputField().updateCursorCounter();
}
}
@Inject(method = "keyTyped", at = @At("HEAD"), cancellable = true)
private void keyTyped(char typedChar, int keyCode, CallbackInfo ci) {
- if (StratusConfig.INSTANCE.getChatSearch() && searchButton.isEnabled()) {
+ if (ChattilsConfig.INSTANCE.getChatSearch() && searchButton.isEnabled()) {
ci.cancel();
if (keyCode == 1) {
searchButton.onMousePress();
@@ -92,7 +95,7 @@ public abstract class GuiChatMixin extends GuiScreen {
float f = mc.ingameGUI.getChatGUI().getChatScale();
int x = MathHelper.floor_float((float) mouseX / f);
if (hook.shouldCopy() && (hook.getRight() + ModCompatHooks.getXOffset()) <= x && (hook.getRight() + ModCompatHooks.getXOffset()) + 9 > x) {
- Transferable message = hook.getStratusChatComponent(Mouse.getY());
+ Transferable message = hook.getChattilsChatComponent(Mouse.getY());
if (message == null) return;
try {
Toolkit.getDefaultToolkit().getSystemClipboard().setContents(message, null);
@@ -104,7 +107,7 @@ public abstract class GuiChatMixin extends GuiScreen {
@ModifyArg(method = "keyTyped", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiChat;sendChatMessage(Ljava/lang/String;)V"), index = 0)
private String modifySentMessage(String original) {
- if (StratusConfig.INSTANCE.getChatShortcuts()) {
+ if (ChattilsConfig.INSTANCE.getChatShortcuts()) {
if (original.startsWith("/")) {
return "/" + ChatShortcuts.INSTANCE.handleSentCommand(StringUtils.substringAfter(original, "/"));
}
diff --git a/src/main/java/com/raeids/stratus/mixin/GuiNewChatAccessor.java b/src/main/java/cc/woverflow/chattils/mixin/GuiNewChatAccessor.java
index 43d4288..1bce77a 100644
--- a/src/main/java/com/raeids/stratus/mixin/GuiNewChatAccessor.java
+++ b/src/main/java/cc/woverflow/chattils/mixin/GuiNewChatAccessor.java
@@ -1,4 +1,4 @@
-package com.raeids.stratus.mixin;
+package cc.woverflow.chattils.mixin;
import net.minecraft.client.gui.ChatLine;
import net.minecraft.client.gui.GuiNewChat;
diff --git a/src/main/java/com/raeids/stratus/mixin/GuiNewChatMapMixin.java b/src/main/java/cc/woverflow/chattils/mixin/GuiNewChatMapMixin.java
index 8f581f9..97d39c5 100644
--- a/src/main/java/com/raeids/stratus/mixin/GuiNewChatMapMixin.java
+++ b/src/main/java/cc/woverflow/chattils/mixin/GuiNewChatMapMixin.java
@@ -1,6 +1,6 @@
-package com.raeids.stratus.mixin;
+package cc.woverflow.chattils.mixin;
-import com.raeids.stratus.hook.GuiNewChatHook;
+import cc.woverflow.chattils.hook.GuiNewChatHook;
import net.minecraft.client.gui.ChatLine;
import net.minecraft.client.gui.GuiNewChat;
import net.minecraft.util.IChatComponent;
@@ -33,7 +33,7 @@ public abstract class GuiNewChatMapMixin implements GuiNewChatHook {
tempDrawnLines.clear();
}
- @Inject(method = "setChatLine", at = @At(value = "INVOKE", target = "Ljava/util/List;add(ILjava/lang/Object;)V", ordinal = 0, shift = At.Shift.AFTER))
+ @Inject(method = "setChatLine", at = @At(value = "INVOKE", target = "Ljava/util/List;add(ILjava/lang/Object;)V", ordinal = 0, shift = At.Shift.AFTER, remap = false))
private void handleDrawnLineAdded(IChatComponent chatComponent, int chatLineId, int updateCounter, boolean displayOnly, CallbackInfo ci) {
if (!displayOnly) tempDrawnLines.add(drawnChatLines.get(0));
else if (lastTempLine != null) {
@@ -41,7 +41,7 @@ public abstract class GuiNewChatMapMixin implements GuiNewChatHook {
}
}
- @Inject(method = "setChatLine", at = @At(value = "INVOKE", target = "Ljava/util/List;remove(I)Ljava/lang/Object;", ordinal = 0, shift = At.Shift.BEFORE))
+ @Inject(method = "setChatLine", at = @At(value = "INVOKE", target = "Ljava/util/List;remove(I)Ljava/lang/Object;", ordinal = 0, shift = At.Shift.BEFORE, remap = false))
private void handleDrawnLineRemoved(IChatComponent chatComponent, int chatLineId, int updateCounter, boolean displayOnly, CallbackInfo ci) {
drawnToFull.remove(drawnChatLines.get(drawnChatLines.size() - 1));
}
diff --git a/src/main/java/com/raeids/stratus/mixin/GuiNewChatMixin.java b/src/main/java/cc/woverflow/chattils/mixin/GuiNewChatMixin.java
index f606d4e..eea68c8 100644
--- a/src/main/java/com/raeids/stratus/mixin/GuiNewChatMixin.java
+++ b/src/main/java/cc/woverflow/chattils/mixin/GuiNewChatMixin.java
@@ -1,12 +1,12 @@
-package com.raeids.stratus.mixin;
-
-import com.raeids.stratus.Stratus;
-import com.raeids.stratus.chat.ChatSearchingManager;
-import com.raeids.stratus.chat.ChatTabs;
-import com.raeids.stratus.config.StratusConfig;
-import com.raeids.stratus.hook.GuiNewChatHook;
-import com.raeids.stratus.utils.ModCompatHooks;
-import com.raeids.stratus.utils.RenderHelper;
+package cc.woverflow.chattils.mixin;
+
+import cc.woverflow.chattils.Chattils;
+import cc.woverflow.chattils.chat.ChatSearchingManager;
+import cc.woverflow.chattils.chat.ChatTabs;
+import cc.woverflow.chattils.config.ChattilsConfig;
+import cc.woverflow.chattils.hook.GuiNewChatHook;
+import cc.woverflow.chattils.utils.ModCompatHooks;
+import cc.woverflow.chattils.utils.RenderHelper;
import gg.essential.universal.UMouse;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.*;
@@ -33,15 +33,15 @@ import java.util.Locale;
@Mixin(value = GuiNewChat.class, priority = Integer.MIN_VALUE)
public abstract class GuiNewChatMixin extends Gui implements GuiNewChatHook {
- @Unique private int stratus$right = 0;
- @Unique private boolean stratus$shouldCopy;
- @Unique private boolean stratus$chatCheck;
- @Unique private int stratus$textOpacity;
+ @Unique private int chattils$right = 0;
+ @Unique private boolean chattils$shouldCopy;
+ @Unique private boolean chattils$chatCheck;
+ @Unique private int chattils$textOpacity;
@Shadow @Final private Minecraft mc;
@Shadow @Final private List<ChatLine> drawnChatLines;
@SuppressWarnings({"FieldCanBeLocal", "unused"})
private float percentComplete;
- private String stratus$previousText = "";
+ private String chattils$previousText = "";
@Shadow public abstract boolean getChatOpen();
@@ -54,12 +54,12 @@ public abstract class GuiNewChatMixin extends Gui implements GuiNewChatHook {
@Shadow public abstract void deleteChatLine(int id);
- @Unique private static final ResourceLocation COPY = new ResourceLocation("stratus:copy.png");
+ @Unique private static final ResourceLocation COPY = new ResourceLocation("chattils:copy.png");
@Inject(method = "printChatMessageWithOptionalDeletion", at = @At("HEAD"), cancellable = true)
private void handlePrintChatMessage(IChatComponent chatComponent, int chatLineId, CallbackInfo ci) {
handleChatTabMessage(chatComponent, chatLineId, mc.ingameGUI.getUpdateCounter(), false, ci);
- if (!EnumChatFormatting.getTextWithoutFormattingCodes(chatComponent.getUnformattedText()).toLowerCase(Locale.ENGLISH).contains(stratus$previousText.toLowerCase(Locale.ENGLISH))) {
+ if (!EnumChatFormatting.getTextWithoutFormattingCodes(chatComponent.getUnformattedText()).toLowerCase(Locale.ENGLISH).contains(chattils$previousText.toLowerCase(Locale.ENGLISH))) {
percentComplete = 1.0F;
}
}
@@ -72,20 +72,20 @@ public abstract class GuiNewChatMixin extends Gui implements GuiNewChatHook {
@Inject(method = "drawChat", at = @At("HEAD"))
private void checkScreenshotKeybind(int j2, CallbackInfo ci) {
- if (Stratus.INSTANCE.getKeybind().isPressed()) {
- Stratus.INSTANCE.setDoTheThing(true);
+ if (Chattils.INSTANCE.getKeybind().isPressed()) {
+ Chattils.INSTANCE.setDoTheThing(true);
}
- stratus$chatCheck = false;
+ chattils$chatCheck = false;
}
@ModifyVariable(method = "drawChat", at = @At("HEAD"), argsOnly = true)
private int setUpdateCounterWhjenYes(int updateCounter) {
- return Stratus.INSTANCE.getDoTheThing() ? 0 : updateCounter;
+ return Chattils.INSTANCE.getDoTheThing() ? 0 : updateCounter;
}
@ModifyVariable(method = "drawChat", at = @At("STORE"), index = 2)
private int setChatLimitWhenYes(int linesToDraw) {
- return Stratus.INSTANCE.getDoTheThing()
+ return Chattils.INSTANCE.getDoTheThing()
? GuiNewChat.calculateChatboxHeight(mc.gameSettings.chatHeightFocused) / 9
: linesToDraw;
}
@@ -103,7 +103,7 @@ public abstract class GuiNewChatMixin extends Gui implements GuiNewChatHook {
mouseX = MathHelper.floor_float((float)mouseX / f);
mouseY = -(MathHelper.floor_float((float)mouseY / f)); //WHY DO I NEED TO DO THIS
if (mouseX >= (left + ModCompatHooks.getXOffset()) && mouseY < bottom && mouseX < (right + 9 + ModCompatHooks.getXOffset()) && mouseY >= top) {
- stratus$shouldCopy = true;
+ chattils$shouldCopy = true;
drawCopyChatBox(right, top);
}
}
@@ -111,12 +111,12 @@ public abstract class GuiNewChatMixin extends Gui implements GuiNewChatHook {
@Redirect(method = "drawChat", at = @At(value = "FIELD", target = "Lnet/minecraft/client/gui/GuiNewChat;drawnChatLines:Ljava/util/List;", opcode = Opcodes.GETFIELD))
private List<ChatLine> injected(GuiNewChat instance) {
- return ChatSearchingManager.filterMessages(stratus$previousText, drawnChatLines);
+ return ChatSearchingManager.filterMessages(chattils$previousText, drawnChatLines);
}
@ModifyVariable(method = "drawChat", at = @At("STORE"), ordinal = 7)
private int modifyYeah(int value) {
- return stratus$textOpacity = (int) (((float) (getChatOpen() ? 255 : value)) * (mc.gameSettings.chatOpacity * 0.9F + 0.1F));
+ return chattils$textOpacity = (int) (((float) (getChatOpen() ? 255 : value)) * (mc.gameSettings.chatOpacity * 0.9F + 0.1F));
}
@Redirect(method = "drawChat", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/FontRenderer;drawStringWithShadow(Ljava/lang/String;FFI)I"))
@@ -126,28 +126,28 @@ public abstract class GuiNewChatMixin extends Gui implements GuiNewChatHook {
@Inject(method = "drawChat", at = @At("RETURN"))
private void checkStuff(int j2, CallbackInfo ci) {
- if (!stratus$chatCheck && stratus$shouldCopy) {
- stratus$shouldCopy = false;
+ if (!chattils$chatCheck && chattils$shouldCopy) {
+ chattils$shouldCopy = false;
}
}
@Inject(method = "getChatHeight", at = @At("HEAD"), cancellable = true)
private void customHeight_getChatHeight(CallbackInfoReturnable<Integer> cir) {
- if (StratusConfig.INSTANCE.getCustomChatHeight()) cir.setReturnValue(Stratus.INSTANCE.getChatHeight(this.getChatOpen()));
+ if (ChattilsConfig.INSTANCE.getCustomChatHeight()) cir.setReturnValue(Chattils.INSTANCE.getChatHeight(this.getChatOpen()));
}
@Override
public int getRight() {
- return stratus$right;
+ return chattils$right;
}
@Override
public boolean shouldCopy() {
- return stratus$shouldCopy;
+ return chattils$shouldCopy;
}
private void handleChatTabMessage(IChatComponent chatComponent, int chatLineId, int updateCounter, boolean displayOnly, CallbackInfo ci) {
- if (StratusConfig.INSTANCE.getChatTabs()) {
+ if (ChattilsConfig.INSTANCE.getChatTabs()) {
if (!ChatTabs.INSTANCE.shouldRender(chatComponent)) {
percentComplete = 1.0F;
if (chatLineId != 0) {
@@ -166,7 +166,7 @@ public abstract class GuiNewChatMixin extends Gui implements GuiNewChatHook {
}
private void drawCopyChatBox(int right, int top) {
- stratus$chatCheck = true;
+ chattils$chatCheck = true;
GlStateManager.enableRescaleNormal();
GlStateManager.enableBlend();
GlStateManager.enableDepth();
@@ -179,7 +179,7 @@ public abstract class GuiNewChatMixin extends Gui implements GuiNewChatHook {
GlStateManager.enableBlend();
GlStateManager.blendFunc(770, 771);
GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f);
- stratus$right = right;
+ chattils$right = right;
Gui.drawModalRectWithCustomSizedTexture(right, top, 0f, 0f, 9, 9, 9, 9);
GlStateManager.disableAlpha();
GlStateManager.disableRescaleNormal();
@@ -188,7 +188,7 @@ public abstract class GuiNewChatMixin extends Gui implements GuiNewChatHook {
}
@Override
- public Transferable getStratusChatComponent(int mouseY) {
+ public Transferable getChattilsChatComponent(int mouseY) {
if (this.getChatOpen()) {
ScaledResolution scaledresolution = new ScaledResolution(this.mc);
int i = scaledresolution.getScaleFactor();
@@ -207,7 +207,7 @@ public abstract class GuiNewChatMixin extends Gui implements GuiNewChatHook {
ChatLine fullLine = this.getFullMessage(subLine);
if (GuiScreen.isShiftKeyDown()) {
if (fullLine != null) {
- BufferedImage image = Stratus.INSTANCE.screenshotLine(fullLine);
+ BufferedImage image = Chattils.INSTANCE.screenshotLine(fullLine);
if (image != null) RenderHelper.INSTANCE.copyBufferedImageToClipboard(image);
}
return null;
@@ -225,16 +225,16 @@ public abstract class GuiNewChatMixin extends Gui implements GuiNewChatHook {
@Override
public String getPrevText() {
- return stratus$previousText;
+ return chattils$previousText;
}
@Override
public void setPrevText(String prevText) {
- stratus$previousText = prevText;
+ chattils$previousText = prevText;
}
@Override
public int getTextOpacity() {
- return stratus$textOpacity;
+ return chattils$textOpacity;
}
}
diff --git a/src/main/java/com/raeids/stratus/mixin/WyvtilsListenerMixin.java b/src/main/java/cc/woverflow/chattils/mixin/WyvtilsListenerMixin.java
index 768b7c7..13a4167 100644
--- a/src/main/java/com/raeids/stratus/mixin/WyvtilsListenerMixin.java
+++ b/src/main/java/cc/woverflow/chattils/mixin/WyvtilsListenerMixin.java
@@ -1,6 +1,6 @@
-package com.raeids.stratus.mixin;
+package cc.woverflow.chattils.mixin;
-import com.raeids.stratus.utils.RenderHelper;
+import cc.woverflow.chattils.utils.RenderHelper;
import org.spongepowered.asm.mixin.Dynamic;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Pseudo;
@@ -14,7 +14,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
public class WyvtilsListenerMixin {
@Dynamic("Wyvtils")
- @Inject(method = "onStringRendered", at = @At("HEAD"), cancellable = true)
+ @Inject(method = "onStringRendered", at = @At("HEAD"), cancellable = true, remap = false)
private void cancelStringRender(@Coerce Object a, CallbackInfo ci) {
if (RenderHelper.INSTANCE.getBypassWyvtils()) ci.cancel();
}
diff --git a/src/main/kotlin/com/raeids/stratus/Stratus.kt b/src/main/kotlin/cc/woverflow/chattils/Chattils.kt
index b998d88..c9714a2 100644
--- a/src/main/kotlin/com/raeids/stratus/Stratus.kt
+++ b/src/main/kotlin/cc/woverflow/chattils/Chattils.kt
@@ -1,15 +1,15 @@
-package com.raeids.stratus
-
-import com.raeids.stratus.chat.ChatSearchingManager
-import com.raeids.stratus.chat.ChatShortcuts
-import com.raeids.stratus.chat.ChatTabs
-import com.raeids.stratus.command.StratusCommand
-import com.raeids.stratus.config.StratusConfig
-import com.raeids.stratus.hook.GuiNewChatHook
-import com.raeids.stratus.mixin.GuiNewChatAccessor
-import com.raeids.stratus.updater.Updater
-import com.raeids.stratus.utils.ModCompatHooks
-import com.raeids.stratus.utils.RenderHelper
+package cc.woverflow.chattils
+
+import cc.woverflow.chattils.chat.ChatSearchingManager
+import cc.woverflow.chattils.chat.ChatShortcuts
+import cc.woverflow.chattils.chat.ChatTabs
+import cc.woverflow.chattils.command.ChattilsCommand
+import cc.woverflow.chattils.config.ChattilsConfig
+import cc.woverflow.chattils.hook.GuiNewChatHook
+import cc.woverflow.chattils.mixin.GuiNewChatAccessor
+import cc.woverflow.chattils.updater.Updater
+import cc.woverflow.chattils.utils.ModCompatHooks
+import cc.woverflow.chattils.utils.RenderHelper
import gg.essential.api.EssentialAPI
import gg.essential.universal.UDesktop
import gg.essential.universal.UResolution
@@ -36,14 +36,14 @@ import java.util.*
@Mod(
- modid = Stratus.ID,
- name = Stratus.NAME,
- version = Stratus.VER,
+ modid = Chattils.ID,
+ name = Chattils.NAME,
+ version = Chattils.VER,
modLanguageAdapter = "gg.essential.api.utils.KotlinAdapter"
)
-object Stratus {
+object Chattils {
- val keybind = KeyBinding("Screenshot Chat", Keyboard.KEY_NONE, "Stratus")
+ val keybind = KeyBinding("Screenshot Chat", Keyboard.KEY_NONE, "Chattils")
const val NAME = "@NAME@"
const val VER = "@VER@"
const val ID = "@ID@"
@@ -67,8 +67,8 @@ object Stratus {
@Mod.EventHandler
fun onInitialization(event: FMLInitializationEvent) {
- StratusConfig.preload()
- StratusCommand.register()
+ ChattilsConfig.preload()
+ ChattilsCommand.register()
ClientRegistry.registerKeyBinding(keybind)
EVENT_BUS.register(this)
ChatTabs.initialize()
@@ -93,7 +93,7 @@ object Stratus {
}
fun getChatHeight(opened: Boolean): Int {
- var height = if (opened) StratusConfig.focusedHeight else StratusConfig.unfocusedHeight
+ var height = if (opened) ChattilsConfig.focusedHeight else ChattilsConfig.unfocusedHeight
height = (height * Minecraft.getMinecraft().gameSettings.chatScale).toInt()
val chatY = ModCompatHooks.yOffset + ModCompatHooks.chatPosition
if (height + chatY + 27 > (UResolution.scaledHeight / Minecraft.getMinecraft().gameSettings.chatScale).toInt() - 27 - chatY) {
@@ -118,7 +118,7 @@ object Stratus {
val chat = hud.chatGUI
val chatLines = ArrayList<String>()
ChatSearchingManager.filterMessages((chat as GuiNewChatHook).prevText, (chat as GuiNewChatAccessor).drawnChatLines)?.let { drawnLines ->
- val chatHeight = if (StratusConfig.customChatHeight) getChatHeight(true) / 9 else GuiNewChat.calculateChatboxHeight(Minecraft.getMinecraft().gameSettings.chatHeightFocused / 9)
+ val chatHeight = if (ChattilsConfig.customChatHeight) getChatHeight(true) / 9 else GuiNewChat.calculateChatboxHeight(Minecraft.getMinecraft().gameSettings.chatHeightFocused / 9)
for (i in scrollPos until drawnLines.size.coerceAtMost(scrollPos + chatHeight)) {
chatLines.add(drawnLines[i].chatComponent.formattedText)
}
@@ -131,7 +131,7 @@ object Stratus {
private fun screenshot(messages: List<String>, width: Int): BufferedImage? {
if (messages.isEmpty()) {
- EssentialAPI.getNotifications().push("Stratus", "Chat window is empty.")
+ EssentialAPI.getNotifications().push("Chattils", "Chat window is empty.")
return null
}
@@ -150,9 +150,9 @@ object Stratus {
Minecraft.getMinecraft().entityRenderer.setupOverlayRendering()
Minecraft.getMinecraft().framebuffer.bindFramebuffer(true)
EssentialAPI.getNotifications()
- .push("Stratus", "Chat screenshotted successfully.\nClick to open.") {
+ .push("Chattils", "Chat screenshotted successfully.\nClick to open.") {
if (!UDesktop.browse(file.toURI())) {
- EssentialAPI.getNotifications().push("Stratus", "Could not browse!")
+ EssentialAPI.getNotifications().push("Chattils", "Could not browse!")
}
}
return image
diff --git a/src/main/kotlin/com/raeids/stratus/chat/ChatRegexes.kt b/src/main/kotlin/cc/woverflow/chattils/chat/ChatRegexes.kt
index 4737177..0776fa0 100644
--- a/src/main/kotlin/com/raeids/stratus/chat/ChatRegexes.kt
+++ b/src/main/kotlin/cc/woverflow/chattils/chat/ChatRegexes.kt
@@ -1,4 +1,4 @@
-package com.raeids.stratus.chat
+package cc.woverflow.chattils.chat
data class ChatRegexes(val regexList: List<String>?) {
val compiledRegexList: MutableList<Regex> = arrayListOf()
diff --git a/src/main/kotlin/com/raeids/stratus/chat/ChatSearchingManager.kt b/src/main/kotlin/cc/woverflow/chattils/chat/ChatSearchingManager.kt
index 030635b..646c218 100644
--- a/src/main/kotlin/com/raeids/stratus/chat/ChatSearchingManager.kt
+++ b/src/main/kotlin/cc/woverflow/chattils/chat/ChatSearchingManager.kt
@@ -1,6 +1,6 @@
-package com.raeids.stratus.chat
+package cc.woverflow.chattils.chat
-import com.raeids.stratus.hook.GuiNewChatHook
+import cc.woverflow.chattils.hook.GuiNewChatHook
import gg.essential.lib.caffeine.cache.Cache
import gg.essential.lib.caffeine.cache.Caffeine
import gg.essential.universal.wrappers.message.UTextComponent
diff --git a/src/main/kotlin/com/raeids/stratus/chat/ChatShortcuts.kt b/src/main/kotlin/cc/woverflow/chattils/chat/ChatShortcuts.kt
index 68fc18e..50cb73c 100644
--- a/src/main/kotlin/com/raeids/stratus/chat/ChatShortcuts.kt
+++ b/src/main/kotlin/cc/woverflow/chattils/chat/ChatShortcuts.kt
@@ -1,17 +1,23 @@
-package com.raeids.stratus.chat
+package cc.woverflow.chattils.chat
+import cc.woverflow.chattils.Chattils
+import cc.woverflow.chattils.utils.ListenableArrayList
import com.google.gson.JsonObject
import com.google.gson.JsonParser
-import com.raeids.stratus.Stratus
import java.io.File
object ChatShortcuts {
- private val shortcutsFile = File(Stratus.modDir, "chatshortcuts.json")
+ private val shortcutsFile = File(Chattils.modDir, "chatshortcuts.json")
private val PARSER = JsonParser()
private var initialized = false
- val shortcuts = mutableSetOf<Pair<String, String>>()
+ val shortcuts = ListenableArrayList<Pair<String, String>>({
+ it.sortWith(comparator)
+ })
+ private val comparator = Comparator<Pair<String, String>> { o1, o2 ->
+ return@Comparator o2.first.length.compareTo(o1.first.length)
+ }
fun initialize() {
diff --git a/src/main/kotlin/com/raeids/stratus/chat/ChatTab.kt b/src/main/kotlin/cc/woverflow/chattils/chat/ChatTab.kt
index ed6712c..87f28a1 100644
--- a/src/main/kotlin/com/raeids/stratus/chat/ChatTab.kt
+++ b/src/main/kotlin/cc/woverflow/chattils/chat/ChatTab.kt
@@ -1,7 +1,7 @@
-package com.raeids.stratus.chat
+package cc.woverflow.chattils.chat
+import cc.woverflow.chattils.gui.components.TabButton
import com.google.gson.annotations.SerializedName
-import com.raeids.stratus.gui.components.TabButton
import kotlinx.coroutines.runBlocking
import net.minecraft.client.Minecraft
import net.minecraft.util.EnumChatFormatting
diff --git a/src/main/kotlin/com/raeids/stratus/chat/ChatTabs.kt b/src/main/kotlin/cc/woverflow/chattils/chat/ChatTabs.kt
index 68e1d23..ada0baa 100644
--- a/src/main/kotlin/com/raeids/stratus/chat/ChatTabs.kt
+++ b/src/main/kotlin/cc/woverflow/chattils/chat/ChatTabs.kt
@@ -1,10 +1,10 @@
-package com.raeids.stratus.chat
+package cc.woverflow.chattils.chat
+import cc.woverflow.chattils.Chattils
import com.google.gson.GsonBuilder
import com.google.gson.JsonArray
import com.google.gson.JsonObject
import com.google.gson.JsonParser
-import com.raeids.stratus.Stratus
import net.minecraft.client.Minecraft
import net.minecraft.util.IChatComponent
import java.io.File
@@ -24,7 +24,7 @@ object ChatTabs {
}
private var initialized = false
- private val tabFile = File(Stratus.modDir, "chattabs.json")
+ private val tabFile = File(Chattils.modDir, "chattabs.json")
fun initialize() {
if (initialized) {
diff --git a/src/main/kotlin/com/raeids/stratus/chat/ChatTabsJson.kt b/src/main/kotlin/cc/woverflow/chattils/chat/ChatTabsJson.kt
index 020c8fc..a63913b 100644
--- a/src/main/kotlin/com/raeids/stratus/chat/ChatTabsJson.kt
+++ b/src/main/kotlin/cc/woverflow/chattils/chat/ChatTabsJson.kt
@@ -1,4 +1,4 @@
-package com.raeids.stratus.chat
+package cc.woverflow.chattils.chat
import com.google.gson.JsonArray
import com.google.gson.annotations.SerializedName
diff --git a/src/main/kotlin/cc/woverflow/chattils/command/ChattilsCommand.kt b/src/main/kotlin/cc/woverflow/chattils/command/ChattilsCommand.kt
new file mode 100644
index 0000000..aa162e1
--- /dev/null
+++ b/src/main/kotlin/cc/woverflow/chattils/command/ChattilsCommand.kt
@@ -0,0 +1,15 @@
+package cc.woverflow.chattils.command
+
+import cc.woverflow.chattils.Chattils
+import cc.woverflow.chattils.config.ChattilsConfig
+import gg.essential.api.EssentialAPI
+import gg.essential.api.commands.Command
+import gg.essential.api.commands.DefaultHandler
+
+object ChattilsCommand : Command(Chattils.ID, true) {
+
+ @DefaultHandler
+ fun handle() {
+ EssentialAPI.getGuiUtil().openScreen(ChattilsConfig.gui())
+ }
+} \ No newline at end of file
diff --git a/src/main/kotlin/com/raeids/stratus/config/StratusConfig.kt b/src/main/kotlin/cc/woverflow/chattils/config/ChattilsConfig.kt
index 4e00bf8..77b9654 100644
--- a/src/main/kotlin/com/raeids/stratus/config/StratusConfig.kt
+++ b/src/main/kotlin/cc/woverflow/chattils/config/ChattilsConfig.kt
@@ -1,12 +1,12 @@
-package com.raeids.stratus.config
-
-import com.raeids.stratus.Stratus
-import com.raeids.stratus.chat.ChatShortcuts
-import com.raeids.stratus.chat.ChatTab
-import com.raeids.stratus.chat.ChatTabs
-import com.raeids.stratus.gui.ChatShortcutViewGui
-import com.raeids.stratus.updater.DownloadGui
-import com.raeids.stratus.updater.Updater
+package cc.woverflow.chattils.config
+
+import cc.woverflow.chattils.Chattils
+import cc.woverflow.chattils.chat.ChatShortcuts
+import cc.woverflow.chattils.chat.ChatTab
+import cc.woverflow.chattils.chat.ChatTabs
+import cc.woverflow.chattils.gui.ChatShortcutViewGui
+import cc.woverflow.chattils.updater.DownloadGui
+import cc.woverflow.chattils.updater.Updater
import gg.essential.api.EssentialAPI
import gg.essential.vigilance.Vigilant
import gg.essential.vigilance.data.Category
@@ -15,7 +15,7 @@ import gg.essential.vigilance.data.PropertyType
import gg.essential.vigilance.data.SortingBehavior
import java.io.File
-object StratusConfig : Vigilant(File(Stratus.modDir, "${Stratus.ID}.toml"), Stratus.NAME, sortingBehavior = ConfigSorting) {
+object ChattilsConfig : Vigilant(File(Chattils.modDir, "${Chattils.ID}.toml"), Chattils.NAME, sortingBehavior = ConfigSorting) {
@Property(
type = PropertyType.SELECTOR,
@@ -151,7 +151,7 @@ object StratusConfig : Vigilant(File(Stratus.modDir, "${Stratus.ID}.toml"), Stra
if (Updater.shouldUpdate) EssentialAPI.getGuiUtil()
.openScreen(DownloadGui()) else EssentialAPI.getNotifications()
.push(
- Stratus.NAME,
+ Chattils.NAME,
"No update had been detected at startup, and thus the update GUI has not been shown."
)
}
diff --git a/src/main/kotlin/com/raeids/stratus/gui/ChatShortcutEditGui.kt b/src/main/kotlin/cc/woverflow/chattils/gui/ChatShortcutEditGui.kt
index 6552c36..aa4b933 100644
--- a/src/main/kotlin/com/raeids/stratus/gui/ChatShortcutEditGui.kt
+++ b/src/main/kotlin/cc/woverflow/chattils/gui/ChatShortcutEditGui.kt
@@ -1,6 +1,6 @@
-package com.raeids.stratus.gui
+package cc.woverflow.chattils.gui
-import com.raeids.stratus.chat.ChatShortcuts
+import cc.woverflow.chattils.chat.ChatShortcuts
import gg.essential.api.EssentialAPI
import gg.essential.api.gui.buildConfirmationModal
import gg.essential.elementa.ElementaVersion
diff --git a/src/main/kotlin/com/raeids/stratus/gui/ChatShortcutViewGui.kt b/src/main/kotlin/cc/woverflow/chattils/gui/ChatShortcutViewGui.kt
index 86989c4..f4ad049 100644
--- a/src/main/kotlin/com/raeids/stratus/gui/ChatShortcutViewGui.kt
+++ b/src/main/kotlin/cc/woverflow/chattils/gui/ChatShortcutViewGui.kt
@@ -1,7 +1,7 @@
-package com.raeids.stratus.gui
+package cc.woverflow.chattils.gui
-import com.raeids.stratus.chat.ChatShortcuts
-import com.raeids.stratus.gui.components.TextBlock
+import cc.woverflow.chattils.chat.ChatShortcuts
+import cc.woverflow.chattils.gui.components.TextBlock
import gg.essential.api.EssentialAPI
import gg.essential.elementa.ElementaVersion
import gg.essential.elementa.WindowScreen
diff --git a/src/main/kotlin/com/raeids/stratus/gui/components/CleanButton.kt b/src/main/kotlin/cc/woverflow/chattils/gui/components/CleanButton.kt
index 7ec29d4..7011518 100644
--- a/src/main/kotlin/com/raeids/stratus/gui/components/CleanButton.kt
+++ b/src/main/kotlin/cc/woverflow/chattils/gui/components/CleanButton.kt
@@ -1,7 +1,7 @@
-package com.raeids.stratus.gui.components
+package cc.woverflow.chattils.gui.components
+import cc.woverflow.chattils.Chattils
import club.sk1er.patcher.config.PatcherConfig
-import com.raeids.stratus.Stratus
import net.minecraft.client.Minecraft
import net.minecraft.client.gui.GuiButton
import net.minecraft.client.renderer.GlStateManager
@@ -41,7 +41,7 @@ open class CleanButton(buttonId: Int, private val x: () -> Int, private val y: (
GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f)
hovered =
mouseX >= xPosition && mouseY >= yPosition && mouseX < xPosition + width && mouseY < yPosition + height
- if (!Stratus.isPatcher || !PatcherConfig.transparentChatInputField) {
+ if (!Chattils.isPatcher || !PatcherConfig.transparentChatInputField) {
drawRect(
xPosition,
yPosition,
diff --git a/src/main/kotlin/com/raeids/stratus/gui/components/ScreenshotButton.kt b/src/main/kotlin/cc/woverflow/chattils/gui/components/ScreenshotButton.kt
index 9e6fa1f..0e6f088 100644
--- a/src/main/kotlin/com/raeids/stratus/gui/components/ScreenshotButton.kt
+++ b/src/main/kotlin/cc/woverflow/chattils/gui/components/ScreenshotButton.kt
@@ -1,7 +1,7 @@
-package com.raeids.stratus.gui.components
+package cc.woverflow.chattils.gui.components
-import com.raeids.stratus.Stratus
-import com.raeids.stratus.mixin.GuiNewChatAccessor
+import cc.woverflow.chattils.Chattils
+import cc.woverflow.chattils.mixin.GuiNewChatAccessor
import gg.essential.api.utils.GuiUtil
import gg.essential.universal.UResolution
import net.minecraft.client.Minecraft
@@ -16,7 +16,7 @@ class ScreenshotButton :
override fun onMousePress() {
val chat = Minecraft.getMinecraft().ingameGUI.chatGUI
if (GuiUtil.getOpenedScreen() is GuiChat) {
- Stratus.screenshotChat((chat as GuiNewChatAccessor).scrollPos)
+ Chattils.screenshotChat((chat as GuiNewChatAccessor).scrollPos)
}
}
@@ -28,7 +28,7 @@ class ScreenshotButton :
} else {
GlStateManager.color(1f, 1f, 1f)
}
- mc.textureManager.bindTexture(ResourceLocation(Stratus.ID, "screenshot.png"))
+ mc.textureManager.bindTexture(ResourceLocation(Chattils.ID, "screenshot.png"))
Gui.drawModalRectWithCustomSizedTexture(xPosition + 1, yPosition + 1, 0f, 0f, 10, 10, 10f, 10f)
}
}
diff --git a/src/main/kotlin/com/raeids/stratus/gui/components/SearchButton.kt b/src/main/kotlin/cc/woverflow/chattils/gui/components/SearchButton.kt
index 3180482..04a2743 100644
--- a/src/main/kotlin/com/raeids/stratus/gui/components/SearchButton.kt
+++ b/src/main/kotlin/cc/woverflow/chattils/gui/components/SearchButton.kt
@@ -1,7 +1,7 @@
-package com.raeids.stratus.gui.components
+package cc.woverflow.chattils.gui.components
-import com.raeids.stratus.Stratus
-import com.raeids.stratus.hook.GuiNewChatHook
+import cc.woverflow.chattils.Chattils
+import cc.woverflow.chattils.hook.GuiNewChatHook
import gg.essential.universal.UResolution
import net.minecraft.client.Minecraft
import net.minecraft.client.gui.Gui
@@ -30,7 +30,7 @@ class SearchButton :
inputField.drawTextBox()
super.drawButton(mc, mouseX, mouseY)
if (visible) {
- mc.textureManager.bindTexture(ResourceLocation(Stratus.ID, "search.png"))
+ mc.textureManager.bindTexture(ResourceLocation(Chattils.ID, "search.png"))
if (isEnabled()) {
GlStateManager.color(224f / 255f, 224f / 255f, 224f / 255f)
} else if (mouseX >= xPosition && mouseX <= xPosition + 10 && mouseY >= yPosition && mouseY <= yPosition + 10) {
diff --git a/src/main/kotlin/com/raeids/stratus/gui/components/TabButton.kt b/src/main/kotlin/cc/woverflow/chattils/gui/components/TabButton.kt
index 48c399a..4770900 100644
--- a/src/main/kotlin/com/raeids/stratus/gui/components/TabButton.kt
+++ b/src/main/kotlin/cc/woverflow/chattils/gui/components/TabButton.kt
@@ -1,7 +1,7 @@
-package com.raeids.stratus.gui.components
+package cc.woverflow.chattils.gui.components
-import com.raeids.stratus.chat.ChatTab
-import com.raeids.stratus.chat.ChatTabs
+import cc.woverflow.chattils.chat.ChatTab
+import cc.woverflow.chattils.chat.ChatTabs
import gg.essential.universal.UResolution
class TabButton(buttonId: Int, x: Int, widthIn: Int, heightIn: Int, private val chatTab: ChatTab) :
diff --git a/src/main/kotlin/com/raeids/stratus/gui/components/TextBlock.kt b/src/main/kotlin/cc/woverflow/chattils/gui/components/TextBlock.kt
index 63b3d01..c83d22d 100644
--- a/src/main/kotlin/com/raeids/stratus/gui/components/TextBlock.kt
+++ b/src/main/kotlin/cc/woverflow/chattils/gui/components/TextBlock.kt
@@ -1,4 +1,4 @@
-package com.raeids.stratus.gui.components
+package cc.woverflow.chattils.gui.components
import gg.essential.elementa.components.UIBlock
import gg.essential.elementa.components.UIText
diff --git a/src/main/kotlin/com/raeids/stratus/updater/DownloadGui.kt b/src/main/kotlin/cc/woverflow/chattils/updater/DownloadGui.kt
index 4fc465f..c7f59ec 100644
--- a/src/main/kotlin/com/raeids/stratus/updater/DownloadGui.kt
+++ b/src/main/kotlin/cc/woverflow/chattils/updater/DownloadGui.kt
@@ -1,6 +1,6 @@
-package com.raeids.stratus.updater
+package cc.woverflow.chattils.updater
-import com.raeids.stratus.Stratus
+import cc.woverflow.chattils.Chattils
import gg.essential.api.EssentialAPI
import gg.essential.api.gui.buildConfirmationModal
import gg.essential.api.utils.Multithreading
@@ -15,32 +15,32 @@ class DownloadGui : WindowScreen(ElementaVersion.V1, true, true, true, -1) {
EssentialAPI.getEssentialComponentFactory().buildConfirmationModal {
this.text = "Are you sure you want to update?"
this.secondaryText =
- "(This will update from v${Stratus.VER} to ${Updater.latestTag})"
+ "(This will update from v${Chattils.VER} to ${Updater.latestTag})"
this.onConfirm = {
restorePreviousScreen()
Multithreading.runAsync {
if (Updater.download(
Updater.updateUrl,
File(
- "mods/${Stratus.NAME}-${
+ "mods/${Chattils.NAME}-${
Updater.latestTag!!.substringAfter("v")
}.jar"
)
) && Updater.download(
"https://github.com/Wyvest/Deleter/releases/download/v1.2/Deleter-1.2.jar",
- File(Stratus.modDir.parentFile, "Deleter-1.2.jar")
+ File(Chattils.modDir.parentFile, "Deleter-1.2.jar")
)
) {
EssentialAPI.getNotifications()
.push(
- Stratus.NAME,
+ Chattils.NAME,
"The ingame updater has successfully installed the newest version."
)
Updater.addShutdownHook()
Updater.shouldUpdate = false
} else {
EssentialAPI.getNotifications().push(
- Stratus.NAME,
+ Chattils.NAME,
"The ingame updater has NOT installed the newest version as something went wrong."
)
}
diff --git a/src/main/kotlin/com/raeids/stratus/updater/Updater.kt b/src/main/kotlin/cc/woverflow/chattils/updater/Updater.kt
index 22ac905..35b6e79 100644
--- a/src/main/kotlin/com/raeids/stratus/updater/Updater.kt
+++ b/src/main/kotlin/cc/woverflow/chattils/updater/Updater.kt
@@ -1,7 +1,7 @@
-package com.raeids.stratus.updater
+package cc.woverflow.chattils.updater
-import com.raeids.stratus.Stratus
-import com.raeids.stratus.config.StratusConfig
+import cc.woverflow.chattils.Chattils
+import cc.woverflow.chattils.config.ChattilsConfig
import gg.essential.api.EssentialAPI
import gg.essential.api.utils.Multithreading
import gg.essential.api.utils.WebUtil.downloadToFile
@@ -21,13 +21,13 @@ object Updater {
Multithreading.runAsync {
try {
val latestRelease =
- fetchJSON("https://api.github.com/repos/W-OVERFLOW/${Stratus.ID}/releases/latest").getObject()
+ fetchJSON("https://api.github.com/repos/W-OVERFLOW/${Chattils.ID}/releases/latest").getObject()
latestTag = latestRelease["tag_name"].asString
val currentVersion =
- DefaultArtifactVersion(Stratus.VER.substringBefore("-"))
+ DefaultArtifactVersion(Chattils.VER.substringBefore("-"))
val latestVersion = DefaultArtifactVersion(latestTag!!.substringAfter("v").substringBefore("-"))
if (currentVersion >= latestVersion) {
- if (currentVersion != latestVersion || !Stratus.VER.contains("-")) {
+ if (currentVersion != latestVersion || !Chattils.VER.contains("-")) {
return@runAsync
}
}
@@ -35,10 +35,10 @@ object Updater {
latestRelease["assets"].asJsonArray[0].asJsonObject["browser_download_url"]
.asString
if (updateUrl.isNotEmpty()) {
- if (StratusConfig.showUpdate) {
+ if (ChattilsConfig.showUpdate) {
EssentialAPI.getNotifications().push(
- Stratus.NAME,
- "${Stratus.NAME} has a new update ($latestTag)! Click here to download it automatically!"
+ Chattils.NAME,
+ "${Chattils.NAME} has a new update ($latestTag)! Click here to download it automatically!"
) { EssentialAPI.getGuiUtil().openScreen(DownloadGui()) }
}
shouldUpdate = true
@@ -54,7 +54,7 @@ object Updater {
if (file.exists()) return true
url = url.replace(" ", "%20")
try {
- downloadToFile(url, file, "${Stratus.NAME}/${Stratus.VER}")
+ downloadToFile(url, file, "${Chattils.NAME}/${Chattils.VER}")
} catch (e: Exception) {
e.printStackTrace()
return false
@@ -72,11 +72,11 @@ object Updater {
try {
val runtime = javaRuntime
if (Minecraft.isRunningOnMac) {
- open(Stratus.jarFile.parentFile)
+ open(Chattils.jarFile.parentFile)
}
- val file = File(Stratus.modDir.parentFile, "Deleter-1.2.jar")
+ val file = File(Chattils.modDir.parentFile, "Deleter-1.2.jar")
Runtime.getRuntime()
- .exec("\"" + runtime + "\" -jar \"" + file.absolutePath + "\" \"" + Stratus.jarFile.absolutePath + "\"")
+ .exec("\"" + runtime + "\" -jar \"" + file.absolutePath + "\" \"" + Chattils.jarFile.absolutePath + "\"")
} catch (e: Exception) {
e.printStackTrace()
}
diff --git a/src/main/kotlin/com/raeids/stratus/utils/ImageTransferable.kt b/src/main/kotlin/cc/woverflow/chattils/utils/ImageTransferable.kt
index a8fe9fb..b23e56e 100644
--- a/src/main/kotlin/com/raeids/stratus/utils/ImageTransferable.kt
+++ b/src/main/kotlin/cc/woverflow/chattils/utils/ImageTransferable.kt
@@ -1,4 +1,4 @@
-package com.raeids.stratus.utils
+package cc.woverflow.chattils.utils
import java.awt.Image
import java.awt.datatransfer.DataFlavor
diff --git a/src/main/kotlin/cc/woverflow/chattils/utils/ListenableArrayList.kt b/src/main/kotlin/cc/woverflow/chattils/utils/ListenableArrayList.kt
new file mode 100644
index 0000000..3b270fd
--- /dev/null
+++ b/src/main/kotlin/cc/woverflow/chattils/utils/ListenableArrayList.kt
@@ -0,0 +1,9 @@
+package cc.woverflow.chattils.utils
+
+class ListenableArrayList<T>(private val runnable: (ListenableArrayList<T>) -> Unit, vararg elements: T): ArrayList<T>() {
+ override fun add(element: T): Boolean {
+ val value = super.add(element)
+ runnable.invoke(this)
+ return value
+ }
+} \ No newline at end of file
diff --git a/src/main/kotlin/com/raeids/stratus/utils/ModCompatHooks.kt b/src/main/kotlin/cc/woverflow/chattils/utils/ModCompatHooks.kt
index dde7165..65c80f0 100644
--- a/src/main/kotlin/com/raeids/stratus/utils/ModCompatHooks.kt
+++ b/src/main/kotlin/cc/woverflow/chattils/utils/ModCompatHooks.kt
@@ -1,11 +1,11 @@
-package com.raeids.stratus.utils
+package cc.woverflow.chattils.utils
import club.sk1er.patcher.config.PatcherConfig
import com.llamalad7.betterchat.BetterChat
-import com.raeids.stratus.Stratus.isBetterChat
-import com.raeids.stratus.Stratus.isPatcher
-import com.raeids.stratus.config.StratusConfig.textRenderType
-import com.raeids.stratus.utils.RenderHelper.drawBorderedString
+import cc.woverflow.chattils.Chattils.isBetterChat
+import cc.woverflow.chattils.Chattils.isPatcher
+import cc.woverflow.chattils.config.ChattilsConfig.textRenderType
+import cc.woverflow.chattils.utils.RenderHelper.drawBorderedString
import net.minecraft.client.Minecraft
import net.minecraft.client.gui.FontRenderer
diff --git a/src/main/kotlin/com/raeids/stratus/utils/RenderHelper.kt b/src/main/kotlin/cc/woverflow/chattils/utils/RenderHelper.kt
index 9e454d7..41325ca 100644
--- a/src/main/kotlin/com/raeids/stratus/utils/RenderHelper.kt
+++ b/src/main/kotlin/cc/woverflow/chattils/utils/RenderHelper.kt
@@ -1,7 +1,7 @@
-package com.raeids.stratus.utils
+package cc.woverflow.chattils.utils
-import com.raeids.stratus.config.StratusConfig
-import com.raeids.stratus.hook.GuiNewChatHook
+import cc.woverflow.chattils.config.ChattilsConfig
+import cc.woverflow.chattils.hook.GuiNewChatHook
import net.minecraft.client.Minecraft
import net.minecraft.client.gui.FontRenderer
import net.minecraft.client.renderer.GlStateManager
@@ -186,7 +186,7 @@ object RenderHelper {
bufferedimage.setRGB(l, k - j, pixelValues[k * framebuffer.framebufferTextureWidth + l])
}
}
- if (StratusConfig.copyMode != 1) {
+ if (ChattilsConfig.copyMode != 1) {
try {
file.parentFile.mkdirs()
ImageIO.write(bufferedimage, "png", file)
diff --git a/src/main/kotlin/com/raeids/stratus/command/StratusCommand.kt b/src/main/kotlin/com/raeids/stratus/command/StratusCommand.kt
deleted file mode 100644
index 2954885..0000000
--- a/src/main/kotlin/com/raeids/stratus/command/StratusCommand.kt
+++ /dev/null
@@ -1,15 +0,0 @@
-package com.raeids.stratus.command
-
-import com.raeids.stratus.Stratus
-import com.raeids.stratus.config.StratusConfig
-import gg.essential.api.EssentialAPI
-import gg.essential.api.commands.Command
-import gg.essential.api.commands.DefaultHandler
-
-object StratusCommand : Command(Stratus.ID, true) {
-
- @DefaultHandler
- fun handle() {
- EssentialAPI.getGuiUtil().openScreen(StratusConfig.gui())
- }
-} \ No newline at end of file
diff --git a/src/main/resources/assets/stratus/copy.png b/src/main/resources/assets/chattils/copy.png
index f21d724..f21d724 100644
--- a/src/main/resources/assets/stratus/copy.png
+++ b/src/main/resources/assets/chattils/copy.png
Binary files differ
diff --git a/src/main/resources/assets/stratus/screenshot.png b/src/main/resources/assets/chattils/screenshot.png
index 8b6cc48..8b6cc48 100644
--- a/src/main/resources/assets/stratus/screenshot.png
+++ b/src/main/resources/assets/chattils/screenshot.png
Binary files differ
diff --git a/src/main/resources/assets/stratus/search.png b/src/main/resources/assets/chattils/search.png
index a5be877..a5be877 100644
--- a/src/main/resources/assets/stratus/search.png
+++ b/src/main/resources/assets/chattils/search.png
Binary files differ
diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info
index b132edf..341b47f 100644
--- a/src/main/resources/mcmod.info
+++ b/src/main/resources/mcmod.info
@@ -8,7 +8,7 @@
"url": "",
"updateUrl": "",
"authorList": [
- "W-OVERFLOW (raeids)"
+ "W-OVERFLOW"
],
"credits": "",
"logoFile": "",
diff --git a/src/main/resources/mixins.stratus.json b/src/main/resources/mixins.chattils.json
index b7deede..356276a 100644
--- a/src/main/resources/mixins.stratus.json
+++ b/src/main/resources/mixins.chattils.json
@@ -1,7 +1,7 @@
{
"compatibilityLevel": "JAVA_8",
"minVersion": "0.8",
- "package": "com.raeids.stratus.mixin",
+ "package": "cc.woverflow.chattils.mixin",
"refmap": "mixins.${id}.refmap.json",
"mixins": [
"ClientCommandHandlerMixin",