Skip to content

Commit

Permalink
feat: Support Minecraft 1.20
Browse files Browse the repository at this point in the history
  • Loading branch information
magicus committed Apr 20, 2024
1 parent d66e89a commit 80db6e9
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 12 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 1.1.0+1.20 - 2024-04-20

### Added

- Support for Minecraft 1.20

## 1.1.0+1.19.4 - 2024-04-20

### Added
Expand Down
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ org.gradle.jvmargs=-Xmx1G

# Fabric Properties
# check these on https://fabricmc.net/develop
minecraft_version=1.19.4
yarn_mappings=1.19.4+build.2
minecraft_version=1.20
yarn_mappings=1.20+build.1
loader_version=0.15.10

# Mod Properties
project_name=Mod Settings
mod_version=1.1.0+1.19.4
mod_version=1.1.0+1.20
maven_group=se.icus.mag
archives_base_name=modsettings

# Fabric api
fabric_version=0.87.2+1.19.4
fabric_version=0.83.0+1.20
5 changes: 3 additions & 2 deletions src/main/java/se/icus/mag/modsettings/gui/ModListWidget.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.google.common.collect.ImmutableList;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.Element;
import net.minecraft.client.gui.Selectable;
import net.minecraft.client.gui.widget.ButtonWidget;
Expand Down Expand Up @@ -61,10 +62,10 @@ public List<? extends Element> children() {
}

@Override
public void render(MatrixStack matrices, int index, int y, int x, int entryWidth, int entryHeight, int mouseX, int mouseY, boolean hovered, float tickDelta) {
public void render(DrawContext context, int index, int y, int x, int entryWidth, int entryHeight, int mouseX, int mouseY, boolean hovered, float tickDelta) {
buttons.forEach(button -> {
button.setY(y);
button.render(matrices, mouseX, mouseY, tickDelta);
button.render(context, mouseX, mouseY, tickDelta);
});
}
}
Expand Down
11 changes: 6 additions & 5 deletions src/main/java/se/icus/mag/modsettings/gui/ModSettingsScreen.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package se.icus.mag.modsettings.gui;

import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.widget.ButtonWidget;
import net.minecraft.client.util.math.MatrixStack;
Expand Down Expand Up @@ -59,11 +60,11 @@ private ModSettingsOption[] getAllModConfigOptions() {
}

@Override
public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) {
this.renderBackground(matrices);
this.list.render(matrices, mouseX, mouseY, delta);
drawCenteredTextWithShadow(matrices, this.textRenderer, this.title, this.width / 2, 5, TITLE_COLOR);
super.render(matrices, mouseX, mouseY, delta);
public void render(DrawContext context, int mouseX, int mouseY, float delta) {
this.renderBackground(context);
this.list.render(context, mouseX, mouseY, delta);
context.drawCenteredTextWithShadow(this.textRenderer, this.title, this.width / 2, 5, TITLE_COLOR);
super.render(context, mouseX, mouseY, delta);
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@
"fabricloader": ">=0.7.4",
"fabric-screen-api-v1": ">=1.0.4",
"fabric-key-binding-api-v1": ">=1.0.1",
"minecraft": "1.19.4"
"minecraft": "~1.20"
}
}

0 comments on commit 80db6e9

Please sign in to comment.