From 58c055597174fb11775290e48b2eb4e3ce3eaaab Mon Sep 17 00:00:00 2001 From: medisant Date: Thu, 22 Jun 2023 16:49:49 +0200 Subject: [PATCH 1/3] update to 1.20 --- build.gradle | 6 ++-- gradle.properties | 11 ++++--- .../advancedchatbox/chat/ChatBoxSection.java | 5 ++-- .../chat/ChatSuggestorGui.java | 30 +++++++++---------- .../gui/ShortcutEntryListWidget.java | 3 +- src/main/resources/fabric.mod.json | 6 ++-- 6 files changed, 31 insertions(+), 30 deletions(-) diff --git a/build.gradle b/build.gradle index ef1aaf8..4562f3d 100644 --- a/build.gradle +++ b/build.gradle @@ -15,6 +15,7 @@ group = project.maven_group repositories { mavenCentral() + mavenLocal() // only used to build the mod locally maven { url 'https://masa.dy.fi/maven' } maven { url 'https://jitpack.io' } } @@ -24,8 +25,9 @@ dependencies { mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2" modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_api_version}" - modImplementation "fi.dy.masa.malilib:malilib-fabric-1.19.0:${project.malilib_version}" - modImplementation "com.github.DarkKronicle:AdvancedChatCore:${project.advancedchat_version}" + modImplementation "fi.dy.masa.malilib:malilib-fabric-1.20.1:${project.malilib_version}" + //modImplementation "com.github.DarkKronicle:AdvancedChatCore:${project.advancedchat_version}" + modImplementation "io.github.darkkronicle:AdvancedChatCore:1.20.1-1.5.10" // only used to build the mod locally implementation "org.languagetool:language-en:5.5" // Transitive diff --git a/gradle.properties b/gradle.properties index ebfa475..7751a6a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,13 +1,12 @@ -minecraft_version=1.19.2 -yarn_mappings=1.19.2+build.1 -loader_version=0.14.9 -fabric_api_version=0.59.0+1.19.2 - +minecraft_version=1.20.1 +yarn_mappings=1.20.1+build.5 +loader_version=0.14.21 +fabric_api_version=0.84.0+1.20.1 mod_version=1.1.6 maven_group=io.github.darkkronicle archives_base_name=AdvancedChatBox -malilib_version = 0.13.0 +malilib_version = 0.16.0 advancedchat_version=1.5.7 mxparser_version=4.4.2 org.gradle.jvmargs=-Xmx3g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 diff --git a/src/main/java/io/github/darkkronicle/advancedchatbox/chat/ChatBoxSection.java b/src/main/java/io/github/darkkronicle/advancedchatbox/chat/ChatBoxSection.java index c1e5a2f..991be48 100644 --- a/src/main/java/io/github/darkkronicle/advancedchatbox/chat/ChatBoxSection.java +++ b/src/main/java/io/github/darkkronicle/advancedchatbox/chat/ChatBoxSection.java @@ -13,6 +13,7 @@ import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.minecraft.client.MinecraftClient; +import net.minecraft.client.gui.DrawContext; import net.minecraft.client.util.math.MatrixStack; @Environment(EnvType.CLIENT) @@ -35,8 +36,8 @@ public boolean keyPressed(int keyCode, int scanCode, int modifiers) { } @Override - public void render(MatrixStack matrixStack, int mouseX, int mouseY, float partialTicks) { - this.suggestor.render(matrixStack, mouseX, mouseY); + public void render(DrawContext context, int mouseX, int mouseY, float partialTicks) { + this.suggestor.render(context, mouseX, mouseY); } @Override diff --git a/src/main/java/io/github/darkkronicle/advancedchatbox/chat/ChatSuggestorGui.java b/src/main/java/io/github/darkkronicle/advancedchatbox/chat/ChatSuggestorGui.java index c0c612a..81bb174 100644 --- a/src/main/java/io/github/darkkronicle/advancedchatbox/chat/ChatSuggestorGui.java +++ b/src/main/java/io/github/darkkronicle/advancedchatbox/chat/ChatSuggestorGui.java @@ -28,11 +28,10 @@ import net.fabricmc.api.Environment; import net.minecraft.client.MinecraftClient; import net.minecraft.client.font.TextRenderer; -import net.minecraft.client.gui.DrawableHelper; +import net.minecraft.client.gui.DrawContext; import net.minecraft.client.gui.screen.Screen; import net.minecraft.client.gui.widget.TextFieldWidget; import net.minecraft.client.resource.language.I18n; -import net.minecraft.client.util.NarratorManager; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.client.util.math.Rect2i; import net.minecraft.command.CommandSource; @@ -245,19 +244,19 @@ private static String getSuggestionSuffix(String original, String suggestion) { return suggestion.startsWith(original) ? suggestion.substring(original.length()) : null; } - public void render(MatrixStack matrices, int mouseX, int mouseY) { + public void render(DrawContext context, int mouseX, int mouseY) { if (this.window != null) { - this.window.render(matrices, mouseX, mouseY); + this.window.render(context, mouseX, mouseY); } else { int i = 0; for (OrderedText message : this.messages) { i++; int j = this.chatScreenSized ? this.owner.height - 14 - 13 - 12 * i : 72 + 12 * i; - DrawableHelper.fill(matrices, this.x - 1, j, this.x + this.width + 1, j + 12, + context.fill(this.x - 1, j, this.x + this.width + 1, j + 12, ChatBoxConfigStorage.General.BACKGROUND_COLOR.config.get().color()); if (message != null) { - this.textRenderer.drawWithShadow(matrices, message, (float) this.x, (float) (j + 2), -1); + context.drawTextWithShadow(textRenderer, message, this.x, j + 2, -1); } } } @@ -293,7 +292,7 @@ private SuggestionWindow(int x, int y, int width, List list, this.select(0); } - public void render(MatrixStack matrices, int mouseX, int mouseY) { + public void render(DrawContext context, int mouseX, int mouseY) { int suggestionSize = Math.min(this.suggestions.size(), ChatSuggestorGui.this.maxSuggestionSize); boolean moreBelow = this.inWindowIndex > 0; boolean moreAbove = this.suggestions.size() > this.inWindowIndex + suggestionSize; @@ -305,10 +304,10 @@ public void render(MatrixStack matrices, int mouseX, int mouseY) { if (more) { // Draw lines to signify that there is more - DrawableHelper.fill(matrices, this.area.getX(), this.area.getY() - 1, + context.fill(this.area.getX(), this.area.getY() - 1, this.area.getX() + this.area.getWidth(), this.area.getY(), ChatBoxConfigStorage.General.BACKGROUND_COLOR.config.get().color()); - DrawableHelper.fill(matrices, this.area.getX(), this.area.getY() + this.area.getHeight(), + context.fill(this.area.getX(), this.area.getY() + this.area.getHeight(), this.area.getX() + this.area.getWidth(), this.area.getY() + this.area.getHeight() + 1, ChatBoxConfigStorage.General.BACKGROUND_COLOR.config.get().color()); int x; @@ -316,7 +315,7 @@ public void render(MatrixStack matrices, int mouseX, int mouseY) { // Dotted for (x = 0; x < this.area.getWidth(); ++x) { if (x % 2 == 0) { - DrawableHelper.fill(matrices, this.area.getX() + x, this.area.getY() - 1, + context.fill(this.area.getX() + x, this.area.getY() - 1, this.area.getX() + x + 1, this.area.getY(), Colors.getInstance().getColorOrWhite("white").color()); } @@ -327,7 +326,7 @@ public void render(MatrixStack matrices, int mouseX, int mouseY) { // Dotted for (x = 0; x < this.area.getWidth(); ++x) { if (x % 2 == 0) { - DrawableHelper.fill(matrices, this.area.getX() + x, + context.fill(this.area.getX() + x, this.area.getY() + this.area.getHeight(), this.area.getX() + x + 1, this.area.getY() + this.area.getHeight() + 1, Colors.getInstance().getColorOrWhite("white").color()); @@ -340,7 +339,7 @@ public void render(MatrixStack matrices, int mouseX, int mouseY) { for (int s = 0; s < suggestionSize; ++s) { AdvancedSuggestion suggestion = this.suggestions.get(s + this.inWindowIndex); - DrawableHelper.fill(matrices, this.area.getX(), this.area.getY() + 12 * s, + context.fill(this.area.getX(), this.area.getY() + 12 * s, this.area.getX() + this.area.getWidth(), this.area.getY() + 12 * s + 12, ChatBoxConfigStorage.General.BACKGROUND_COLOR.config.get().color()); if (mouseX > this.area.getX() && mouseX < this.area.getX() + this.area.getWidth() @@ -351,9 +350,8 @@ public void render(MatrixStack matrices, int mouseX, int mouseY) { hover = true; } - - ChatSuggestorGui.this.textRenderer.drawWithShadow(matrices, suggestion.getRender(), - (float) (this.area.getX() + 1), (float) (this.area.getY() + 2 + 12 * s), + context.drawTextWithShadow(ChatSuggestorGui.this.textRenderer, suggestion.getRender(), + (this.area.getX() + 1), (this.area.getY() + 2 + 12 * s), (s + this.inWindowIndex) == this.selection ? ChatBoxConfigStorage.General.HIGHLIGHT_COLOR.config.get().color() : ChatBoxConfigStorage.General.UNHIGHLIGHT_COLOR.config.get().color()); @@ -362,7 +360,7 @@ public void render(MatrixStack matrices, int mouseX, int mouseY) { if (hover) { Message message = this.suggestions.get(this.selection).getTooltip(); if (message != null) { - ChatSuggestorGui.this.owner.renderTooltip(matrices, Texts.toText(message), mouseX, mouseY); + context.drawTooltip(textRenderer, Texts.toText(message), mouseX, mouseY); } } } diff --git a/src/main/java/io/github/darkkronicle/advancedchatbox/suggester/gui/ShortcutEntryListWidget.java b/src/main/java/io/github/darkkronicle/advancedchatbox/suggester/gui/ShortcutEntryListWidget.java index f17ce34..cbdbd04 100644 --- a/src/main/java/io/github/darkkronicle/advancedchatbox/suggester/gui/ShortcutEntryListWidget.java +++ b/src/main/java/io/github/darkkronicle/advancedchatbox/suggester/gui/ShortcutEntryListWidget.java @@ -21,6 +21,7 @@ import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.minecraft.client.MinecraftClient; +import net.minecraft.client.gui.DrawContext; import net.minecraft.client.util.math.MatrixStack; @Environment(EnvType.CLIENT) @@ -94,5 +95,5 @@ protected int addButton(int x, int y, String translation, IButtonActionListener } @Override - public void renderEntry(int mouseX, int mouseY, boolean selected, MatrixStack matrixStack) {} + public void renderEntry(int mouseX, int mouseY, boolean selected, DrawContext context) {} } diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 7b5e081..4c27ef3 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -21,10 +21,10 @@ ] }, "depends": { - "fabricloader": ">=0.8.9+build.204", + "fabricloader": ">=0.14.18", "fabric": "*", - "minecraft": ">=1.19", - "malilib": ">=0.13.0", + "minecraft": ">=1.20", + "malilib": ">=0.16.0", "advancedchatcore": ">=1.5.0-1.19" }, "custom": { From 486741ccb515d6a341675bc8355d5e2c4b2f47c0 Mon Sep 17 00:00:00 2001 From: medisant Date: Wed, 25 Oct 2023 16:46:27 +0200 Subject: [PATCH 2/3] update to 1.20.2 --- build.gradle | 4 ++-- gradle.properties | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/build.gradle b/build.gradle index 4562f3d..8d79604 100644 --- a/build.gradle +++ b/build.gradle @@ -25,9 +25,9 @@ dependencies { mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2" modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_api_version}" - modImplementation "fi.dy.masa.malilib:malilib-fabric-1.20.1:${project.malilib_version}" + modImplementation "fi.dy.masa.malilib:malilib-fabric-1.20.2:${project.malilib_version}" //modImplementation "com.github.DarkKronicle:AdvancedChatCore:${project.advancedchat_version}" - modImplementation "io.github.darkkronicle:AdvancedChatCore:1.20.1-1.5.10" // only used to build the mod locally + modImplementation "io.github.darkkronicle:AdvancedChatCore:1.20.2-1.5.10" // only used to build the mod locally implementation "org.languagetool:language-en:5.5" // Transitive diff --git a/gradle.properties b/gradle.properties index 7751a6a..1d84dac 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,12 +1,12 @@ -minecraft_version=1.20.1 -yarn_mappings=1.20.1+build.5 -loader_version=0.14.21 -fabric_api_version=0.84.0+1.20.1 +minecraft_version=1.20.2 +yarn_mappings=1.20.2+build.4 +loader_version=0.14.24 +fabric_api_version=0.90.4+1.20.2 mod_version=1.1.6 maven_group=io.github.darkkronicle archives_base_name=AdvancedChatBox -malilib_version = 0.16.0 +malilib_version = 0.17.0 advancedchat_version=1.5.7 mxparser_version=4.4.2 org.gradle.jvmargs=-Xmx3g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 From c5832353688551ef2fac3d0a8c1ed05054b831e6 Mon Sep 17 00:00:00 2001 From: medisant Date: Wed, 10 Jan 2024 21:15:09 +0100 Subject: [PATCH 3/3] update to 1.20.2 --- build.gradle | 2 +- gradle.properties | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/build.gradle b/build.gradle index 8d79604..f47f413 100644 --- a/build.gradle +++ b/build.gradle @@ -27,7 +27,7 @@ dependencies { modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_api_version}" modImplementation "fi.dy.masa.malilib:malilib-fabric-1.20.2:${project.malilib_version}" //modImplementation "com.github.DarkKronicle:AdvancedChatCore:${project.advancedchat_version}" - modImplementation "io.github.darkkronicle:AdvancedChatCore:1.20.2-1.5.10" // only used to build the mod locally + modImplementation "io.github.darkkronicle:AdvancedChatCore:1.20.4-1.5.10" // only used to build the mod locally implementation "org.languagetool:language-en:5.5" // Transitive diff --git a/gradle.properties b/gradle.properties index 1d84dac..77a1ea2 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,7 @@ -minecraft_version=1.20.2 -yarn_mappings=1.20.2+build.4 -loader_version=0.14.24 -fabric_api_version=0.90.4+1.20.2 +minecraft_version=1.20.4 +yarn_mappings=1.20.4+build.3 +loader_version=0.15.3 +fabric_api_version=0.92.0+1.20.4 mod_version=1.1.6 maven_group=io.github.darkkronicle