Skip to content

Commit

Permalink
update to 1.21.4
Browse files Browse the repository at this point in the history
  • Loading branch information
moehreag committed Dec 3, 2024
1 parent b17c413 commit b4a4e26
Show file tree
Hide file tree
Showing 63 changed files with 25 additions and 40 deletions.
4 changes: 2 additions & 2 deletions 1.21.3/build.gradle → 1.21.4/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ plugins {
id "fabric-loom"
}

def minecraft_version = "1.21.3"
def fapi_version = "0.110.0"
def minecraft_version = "1.21.4"
def fapi_version = "0.110.5"
group = maven_group
version = "${project.version}+${minecraft_version}"
archivesBaseName = "AxolotlClient-config"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@

package io.github.axolotlclient.AxolotlClientConfig.impl.ui.rounded;

import java.util.*;
import java.util.stream.Stream;

import io.github.axolotlclient.AxolotlClientConfig.api.manager.ConfigManager;
import io.github.axolotlclient.AxolotlClientConfig.api.options.Option;
import io.github.axolotlclient.AxolotlClientConfig.api.options.OptionCategory;
Expand All @@ -32,18 +35,13 @@
import io.github.axolotlclient.AxolotlClientConfig.impl.util.ConfigStyles;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.gui.components.AbstractButton;
import net.minecraft.client.gui.components.AbstractWidget;
import net.minecraft.client.gui.components.ContainerObjectSelectionList;
import net.minecraft.client.gui.components.events.GuiEventListener;
import net.minecraft.client.gui.narration.NarratableEntry;
import net.minecraft.client.resources.language.I18n;
import net.minecraft.util.Mth;
import org.jetbrains.annotations.Nullable;

import java.util.*;
import java.util.stream.Stream;

public class ButtonListWidget extends ContainerObjectSelectionList<ButtonListWidget.Entry> implements DrawingUtil {

protected static int WIDGET_WIDTH = 150;
Expand All @@ -55,7 +53,7 @@ public class ButtonListWidget extends ContainerObjectSelectionList<ButtonListWid
private final OptionCategory category;

public ButtonListWidget(ConfigManager manager, OptionCategory category, int screenWidth, int screenHeight, int top, int bottom, int entryHeight) {
super(Minecraft.getInstance(), screenWidth, bottom-top, top, entryHeight);
super(Minecraft.getInstance(), screenWidth, bottom - top, top, entryHeight);
centerListVertically = false;
this.manager = manager;
this.category = category;
Expand Down Expand Up @@ -144,10 +142,6 @@ public int getRowWidth() {
return 308;
}

@Override
protected boolean scrollbarVisible() {
return false;
}
protected void renderListBackground(GuiGraphics guiGraphics) {
}

Expand All @@ -160,19 +154,13 @@ public boolean mouseScrolled(double mouseX, double mouseY, double scrollX, doubl
}

@Override
protected void renderDecorations(GuiGraphics guiGraphics, int mouseX, int mouseY) {
int i = this.getMaxScroll();
if (i > 0) {
int j = this.getScrollbarPosition();
int k = (int) ((float) ((this.height) * (this.height)) / (float) this.getMaxPosition());
k = Mth.clamp(k, 32, this.height - 8);
int l = (int) this.getScrollAmount() * (this.height - k) / i + this.getY();
if (l < this.getY()) {
l = this.getY();
}

fillRoundedRect(NVGHolder.getContext(), j, getY(), 6, getHeight(), Colors.foreground(), 6 / 2);
fillRoundedRect(NVGHolder.getContext(), j, l, 6, k, Colors.accent(), 6 / 2);
protected void renderScrollbar(GuiGraphics guiGraphics) {
if (this.scrollbarVisible()) {
int i = this.scrollBarX();
int j = this.scrollerHeight();
int k = this.scrollBarY();
fillRoundedRect(NVGHolder.getContext(), i, getY(), 6, getHeight(), Colors.foreground(), 6 / 2);
fillRoundedRect(NVGHolder.getContext(), i, k, 6, j, Colors.accent(), 6 / 2);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public ResetButtonWidget(int x, int y, int width, int height, Option<T> option)
current.children().stream()
.filter(e -> e instanceof RoundedButtonListWidget)
.map(e -> (RoundedButtonListWidget) e).findFirst().ifPresent(list -> {
scroll.set(list.getScrollAmount());
scroll.set(list.scrollAmount());
});
current.init(Minecraft.getInstance(), i, j);
current.children().stream()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@

package io.github.axolotlclient.AxolotlClientConfig.impl.ui.vanilla;

import java.util.*;
import java.util.stream.Stream;

import io.github.axolotlclient.AxolotlClientConfig.api.manager.ConfigManager;
import io.github.axolotlclient.AxolotlClientConfig.api.options.Option;
import io.github.axolotlclient.AxolotlClientConfig.api.options.OptionCategory;
Expand All @@ -30,18 +33,13 @@
import io.github.axolotlclient.AxolotlClientConfig.impl.util.ConfigStyles;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.gui.components.AbstractButton;
import net.minecraft.client.gui.components.AbstractWidget;
import net.minecraft.client.gui.components.ContainerObjectSelectionList;
import net.minecraft.client.gui.components.events.ContainerEventHandler;
import net.minecraft.client.gui.components.events.GuiEventListener;
import net.minecraft.client.gui.narration.NarratableEntry;
import net.minecraft.client.resources.language.I18n;
import org.jetbrains.annotations.Nullable;

import java.util.*;
import java.util.stream.Stream;

public class EntryListWidget extends ContainerObjectSelectionList<EntryListWidget.Entry> {

protected static int WIDGET_WIDTH = 150;
Expand Down Expand Up @@ -130,7 +128,7 @@ protected void collectEntries(OptionCategory current, List<OptionCategory> categ
}

@Override
protected boolean isValidMouseClick(int index) {
protected boolean isValidClickButton(int index) {
return true;
}

Expand All @@ -148,8 +146,8 @@ public int getRowWidth() {
}

@Override
protected int getScrollbarPosition() {
return super.getScrollbarPosition() - 2;
protected int scrollBarX() {
return super.scrollBarX() - 2;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public ResetButtonWidget(int x, int y, int width, int height, Option<T> option)
current.children().stream()
.filter(e -> e instanceof VanillaEntryListWidget)
.map(e -> (VanillaEntryListWidget) e).findFirst().ifPresent(list -> {
scroll.set(list.getScrollAmount());
scroll.set(list.scrollAmount());
});
current.init(Minecraft.getInstance(), i, j);
current.children().stream()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
public class VanillaEntryListWidget extends EntryListWidget {
public VanillaEntryListWidget(ConfigManager manager, OptionCategory category, int screenWidth, int screenHeight, int top, int bottom, int entryHeight) {
super(manager, category, screenWidth, screenHeight, top, bottom, entryHeight);
setRenderHeader(false, headerHeight);
}

protected void addOptions(ConfigManager manager, Collection<Option<?>> options) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"required": true,
"minVersion": "0.8",
"package": "io.github.axolotlclient.AxolotlClientConfig.impl.mixin",
"compatibilityLevel": "JAVA_17",
"compatibilityLevel": "JAVA_21",
"mixins": [],
"client": [
"NativeImageInvoker"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
],
"depends": {
"fabricloader": ">=0.14.0",
"minecraft": "1.21.3",
"fabric-lifecycle-events-v1": "*"
"minecraft": "1.21.4",
"fabric-api": "*"
}
}
File renamed without changes.
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ include '1.8.9'
include '1.16_combat-6'
include '1.20'
include '1.21'
include '1.21.3'
include '1.21.4'

0 comments on commit b4a4e26

Please sign in to comment.