Skip to content

Commit

Permalink
feat: Support Minecraft 1.20.3
Browse files Browse the repository at this point in the history
  • Loading branch information
magicus committed Apr 20, 2024
1 parent 5a43988 commit 676e7c7
Show file tree
Hide file tree
Showing 5 changed files with 15 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.3 - 2024-04-20

### Added

- Support for Minecraft 1.20.3

## 1.1.0+1.20.2 - 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.20.2
yarn_mappings=1.20.2+build.4
minecraft_version=1.20.3
yarn_mappings=1.20.3+build.1
loader_version=0.15.10

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

# Fabric api
fabric_version=0.91.6+1.20.2
fabric_version=0.91.1+1.20.3
5 changes: 2 additions & 3 deletions src/main/java/se/icus/mag/modsettings/gui/ModListWidget.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,15 @@
import net.minecraft.client.gui.Selectable;
import net.minecraft.client.gui.widget.ButtonWidget;
import net.minecraft.client.gui.widget.ElementListWidget;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.text.Text;

import java.util.List;

public class ModListWidget extends ElementListWidget<ModListWidget.Entry> {
private static final int BUTTON_HEIGHT = 20;

public ModListWidget(MinecraftClient client, int width, int height, int top, int bottom, int itemHeight) {
super(client, width, height, top, bottom, itemHeight);
public ModListWidget(MinecraftClient client, int width, int height, int y, int itemHeight) {
super(client, width, height, y, itemHeight);
this.centerListVertically = false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

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;
import net.minecraft.screen.ScreenTexts;
import net.minecraft.text.Text;
import se.icus.mag.modsettings.Main;
Expand Down Expand Up @@ -34,10 +32,11 @@ protected void init() {
initIsProcessing = true;

// Put list between 32 pixels from top and bottom
this.list = new ModListWidget(this.client, this.width, this.height, 32, this.height - 32, 25);
this.list = new ModListWidget(this.client, this.width, this.height - 64, 32, 25);
this.list.addAll(getAllModConfigOptions());

this.addSelectableChild(this.list);
this.addDrawableChild(this.list);
this.addDrawableChild(new Button(this.width / 2 - FULL_BUTTON_WIDTH / 2, this.height - 27,
FULL_BUTTON_WIDTH, BUTTON_HEIGHT, ScreenTexts.DONE,
button -> this.client.setScreen(this.previous)));
Expand All @@ -62,7 +61,6 @@ private ModSettingsOption[] getAllModConfigOptions() {
@Override
public void render(DrawContext context, int mouseX, int mouseY, float delta) {
super.render(context, mouseX, mouseY, delta);
this.list.render(context, mouseX, mouseY, delta);
context.drawCenteredTextWithShadow(this.textRenderer, this.title, this.width / 2, 5, TITLE_COLOR);
}

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.20.2"
"minecraft": "~1.20.3"
}
}

0 comments on commit 676e7c7

Please sign in to comment.