Skip to content
This repository was archived by the owner on Sep 19, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ apply from: 'https://raw.githubusercontent.com/DarkKronicle/GradleScripts/main/g

repositories {
mavenCentral()
mavenLocal() // only used to build the mod locally
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove when not building locally

maven { url 'https://masa.dy.fi/maven' }
maven { url 'https://jitpack.io' }
}
Expand All @@ -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.4:${project.malilib_version}"
modImplementation "com.github.DarkKronicle:AdvancedChatCore:${project.advancedchat_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.4-1.5.10" // only used to build the mod locally

implementation 'org.openjdk.nashorn:nashorn-core:15.3'
implementation 'org.javadelight:delight-nashorn-sandbox:0.2.5'
Expand Down
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
minecraft_version=1.19.4
yarn_mappings=1.19.4+build.1
loader_version=0.14.18
fabric_api_version=0.76.0+1.19.4
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.2.8
maven_group=io.github.darkkronicle
archives_base_name=AdvancedChatFilters

malilib_version = 0.15.2
malilib_version = 0.17.0
org.gradle.jvmargs=-Xmx1G
advancedchat_version=v1.5.10
owo_version=2.0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import java.util.ArrayList;
import java.util.List;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.text.MutableText;
Expand Down Expand Up @@ -60,13 +61,12 @@ public void back() {
}

@Override
public void render(MatrixStack matrixStack, int mouseX, int mouseY, float partialTicks) {
super.render(matrixStack, mouseX, mouseY, partialTicks);
public void render(DrawContext context, int mouseX, int mouseY, float partialTicks) {
super.render(context, mouseX, mouseY, partialTicks);
int width = client.getWindow().getScaledWidth();
int y = 100;
for (OrderedText warn : warning) {
drawCenteredTextWithShadow(
matrixStack,
context.drawCenteredTextWithShadow(
client.textRenderer,
warn,
width / 2,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import io.github.darkkronicle.advancedchatfilters.filters.ParentFilter;
import io.github.darkkronicle.advancedchatfilters.filters.ReplaceFilter;
import io.github.darkkronicle.advancedchatfilters.registry.MatchReplaceRegistry;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.text.MutableText;
Expand Down Expand Up @@ -78,13 +79,13 @@ protected void closeGui(boolean showParent) {
}

@Override
public void render(MatrixStack matrixStack, int mouseX, int mouseY, float partialTicks) {
super.render(matrixStack, mouseX, mouseY, partialTicks);
public void render(DrawContext context, int mouseX, int mouseY, float partialTicks) {
super.render(context, mouseX, mouseY, partialTicks);
int y = test.getY() + 20;
int x = 10;
for (Text t : outputMessage) {
if (t != null) {
textRenderer.drawWithShadow(matrixStack, t, x, y, -1);
context.drawTextWithShadow(textRenderer, t, x, y, -1);
}
y += textRenderer.fontHeight + 2;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,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)
Expand Down Expand Up @@ -121,7 +122,7 @@ private ButtonOnOff addOnOffButton(
}

@Override
public void render(int mouseX, int mouseY, boolean selected, MatrixStack matrixStack) {
public void render(int mouseX, int mouseY, boolean selected, DrawContext context) {
RenderUtils.color(1f, 1f, 1f, 1f);

// Draw a lighter background for the hovered and the selected entry
Expand Down Expand Up @@ -153,14 +154,14 @@ public void render(int mouseX, int mouseY, boolean selected, MatrixStack matrixS
this.y + 7,
Colors.getInstance().getColorOrWhite("white").color(),
name,
matrixStack);
context);

RenderUtils.color(1f, 1f, 1f, 1f);
RenderSystem.disableBlend();

this.drawTextFields(mouseX, mouseY, matrixStack);
this.drawTextFields(mouseX, mouseY, context);

super.render(mouseX, mouseY, selected, matrixStack);
super.render(mouseX, mouseY, selected, context);

RenderUtils.disableDiffuseLighting();
}
Expand Down Expand Up @@ -257,16 +258,16 @@ protected boolean onMouseClickedImpl(int mouseX, int mouseY, int mouseButton) {
return ret;
}

protected void drawTextFields(int mouseX, int mouseY, MatrixStack matrixStack) {
protected void drawTextFields(int mouseX, int mouseY, DrawContext context) {
if (this.num != null) {
this.num.getTextField().render(matrixStack, mouseX, mouseY, 0f);
this.num.getTextField().render(context, mouseX, mouseY, 0f);
}
}

@Override
public void postRenderHovered(
int mouseX, int mouseY, boolean selected, MatrixStack matrixStack) {
super.postRenderHovered(mouseX, mouseY, selected, matrixStack);
int mouseX, int mouseY, boolean selected, DrawContext context) {
super.postRenderHovered(mouseX, mouseY, selected, context);

List<String> hoverLines;

Expand All @@ -285,7 +286,7 @@ public void postRenderHovered(
&& mouseX < this.buttonStartX
&& mouseY >= this.y
&& mouseY <= this.y + this.height) {
RenderUtils.drawHoverText(mouseX, mouseY, hoverLines, matrixStack);
RenderUtils.drawHoverText(mouseX, mouseY, hoverLines, context);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,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;

/*
Expand Down Expand Up @@ -130,7 +131,7 @@ private int addOnOffButton(int xRight, int y, ButtonListener.Type type, boolean
}

@Override
public void render(int mouseX, int mouseY, boolean selected, MatrixStack matrixStack) {
public void render(int mouseX, int mouseY, boolean selected, DrawContext context) {
RenderUtils.color(1f, 1f, 1f, 1f);

// Draw a lighter background for the hovered and the selected entry
Expand Down Expand Up @@ -162,28 +163,28 @@ public void render(int mouseX, int mouseY, boolean selected, MatrixStack matrixS
this.y + 7,
Colors.getInstance().getColorOrWhite("white").color(),
name,
matrixStack);
context);

RenderUtils.color(1f, 1f, 1f, 1f);
RenderSystem.disableBlend();

this.drawTextFields(mouseX, mouseY, matrixStack);
this.drawTextFields(mouseX, mouseY, context);

super.render(mouseX, mouseY, selected, matrixStack);
super.render(mouseX, mouseY, selected, context);

RenderUtils.disableDiffuseLighting();
}

@Override
public void postRenderHovered(
int mouseX, int mouseY, boolean selected, MatrixStack matrixStack) {
super.postRenderHovered(mouseX, mouseY, selected, matrixStack);
int mouseX, int mouseY, boolean selected, DrawContext context) {
super.postRenderHovered(mouseX, mouseY, selected, context);

if (mouseX >= this.x
&& mouseX < this.buttonStartX
&& mouseY >= this.y
&& mouseY <= this.y + this.height) {
RenderUtils.drawHoverText(mouseX, mouseY, this.hoverLines, matrixStack);
RenderUtils.drawHoverText(mouseX, mouseY, this.hoverLines, context);
}
}

Expand Down Expand Up @@ -291,9 +292,9 @@ protected boolean onMouseClickedImpl(int mouseX, int mouseY, int mouseButton) {
return ret;
}

protected void drawTextFields(int mouseX, int mouseY, MatrixStack matrixStack) {
protected void drawTextFields(int mouseX, int mouseY, DrawContext context) {
if (this.num != null) {
this.num.getTextField().render(matrixStack, mouseX, mouseY, 0f);
this.num.getTextField().render(context, mouseX, mouseY, 0f);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.util.math.MatrixStack;

Expand Down Expand Up @@ -48,8 +50,8 @@ public void addTextField(TextFieldWrapper<? extends GuiTextFieldGeneric> text) {
}

@Override
public void render(MatrixStack matrixStack, int mouseX, int mouseY, float partialTicks) {
super.render(matrixStack, mouseX, mouseY, partialTicks);
public void render(DrawContext context, int mouseX, int mouseY, float partialTicks) {
super.render(context, mouseX, mouseY, partialTicks);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.util.math.MatrixStack;

Expand Down Expand Up @@ -50,8 +52,8 @@ public void addTextField(TextFieldWrapper<? extends GuiTextFieldGeneric> text) {
}

@Override
public void render(MatrixStack matrixStack, int mouseX, int mouseY, float partialTicks) {
super.render(matrixStack, mouseX, mouseY, partialTicks);
public void render(DrawContext context, int mouseX, int mouseY, float partialTicks) {
super.render(context, mouseX, mouseY, partialTicks);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public TextBuilder concatenate(String content) {
* @param value Content of that action
*/
public TextBuilder setClickEvent(String action, String value) {
ClickEvent.Action clickAction = ClickEvent.Action.byName(action);
ClickEvent.Action clickAction = ClickEvent.Action.valueOf(action);
if (!clickAction.isUserDefinable()) {
return this;
}
Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
"depends": {
"fabricloader": ">=0.14.18",
"fabric": "*",
"minecraft": ">=1.19.4",
"malilib": ">=0.15.2",
"advancedchatcore": ">=1.5.10-1.18"
"minecraft": ">=1.20",
"malilib": ">=0.16.0",
"advancedchatcore": ">=1.5.10-1.19"
},
"custom": {
"acmodule": true,
Expand Down