diff --git a/gradle.properties b/gradle.properties index 7378496..173a5e9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,6 +6,6 @@ org.gradle.jvmargs = -Xmx1G vt_version = 1.20 # Remember to also update on VTDMod.java -mod_version = 2.1.0 +mod_version = 2.2.0 maven_group = dev.iotabread archives_base_name = vt-downloader diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index ff49e41..111e1a8 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,12 +1,12 @@ [versions] -minecraft = "1.20.2" -quilt_mappings = "1.20.2+build.3" -fabric_loader = "0.14.22" +minecraft = "1.20.4" +quilt_mappings = "1.20.4+build.3" +fabric_loader = "0.15.1" -fabric_api = "0.89.3+1.20.2" +fabric_api = "0.96.11+1.20.4" # Other mods -recursive_resources = "2.5.2+1.20" +recursive_resources = "2.5.2+1.20.4" [libraries] minecraft = { module = "com.mojang:minecraft", version.ref = "minecraft" } diff --git a/src/main/java/me/bymartrixx/vtd/VTDMod.java b/src/main/java/me/bymartrixx/vtd/VTDMod.java index 9a0d54e..e1551dd 100644 --- a/src/main/java/me/bymartrixx/vtd/VTDMod.java +++ b/src/main/java/me/bymartrixx/vtd/VTDMod.java @@ -80,7 +80,7 @@ public class VTDMod implements ClientModInitializer { public static RpCategories rpCategories; static { - String version = "2.0.7"; + String version = "2.2.0"; String vtVersion = "1.20"; Optional container = FabricLoader.getInstance().getModContainer(MOD_ID); diff --git a/src/main/java/me/bymartrixx/vtd/gui/VTDownloadScreen.java b/src/main/java/me/bymartrixx/vtd/gui/VTDownloadScreen.java index 817cadc..0207b83 100644 --- a/src/main/java/me/bymartrixx/vtd/gui/VTDownloadScreen.java +++ b/src/main/java/me/bymartrixx/vtd/gui/VTDownloadScreen.java @@ -123,7 +123,7 @@ public VTDownloadScreen(Screen parent, Text subtitle) { this.subtitle = subtitle; this.categories = VTDMod.rpCategories.getCategories(); - this.currentCategory = this.categories.size() > 0 ? this.categories.get(0) : null; + this.currentCategory = !this.categories.isEmpty() ? this.categories.get(0) : null; this.selectionHelper.addCallback((pack, category, selected) -> { this.changed = true; @@ -154,7 +154,7 @@ private void updateCategories(RpCategories data) { this.selectionHelper.cleanUpSelection(); this.selectedPacksList.update(); - this.currentCategory = this.categories.size() > 0 ? this.categories.get(0) : null; + this.currentCategory = !this.categories.isEmpty() ? this.categories.get(0) : null; this.categorySelector.setSelectedCategory(this.currentCategory); this.packSelector.setCategory(this.currentCategory); } @@ -304,14 +304,15 @@ protected void init() { // Draw before everything else this.packSelector = this.addDrawable(new PackSelectionListWidget(this.client, this, this.width, - this.height, PACK_SELECTOR_TOP_HEIGHT, this.height - PACK_SELECTOR_BOTTOM_HEIGHT, + this.height - PACK_SELECTOR_TOP_HEIGHT - PACK_SELECTOR_BOTTOM_HEIGHT, + PACK_SELECTOR_TOP_HEIGHT, this.currentCategory, this.selectionHelper)); this.packSelector.updateCategories(this.categories); this.selectedPacksList = this.addDrawable(new SelectedPacksListWidget(this, this.client, - SELECTED_PACKS_WIDTH, SELECTED_PACKS_TOP_HEIGHT, - this.height - SELECTED_PACKS_BOTTOM_HEIGHT, - this.width - SELECTED_PACKS_WIDTH, this.selectionHelper)); + SELECTED_PACKS_WIDTH, this.height - SELECTED_PACKS_TOP_HEIGHT - SELECTED_PACKS_BOTTOM_HEIGHT, + this.width - SELECTED_PACKS_WIDTH, SELECTED_PACKS_TOP_HEIGHT, + this.selectionHelper)); // Reload button this.addDrawableSelectableElement(new ReloadButtonWidget(WIDGET_MARGIN, WIDGET_MARGIN, diff --git a/src/main/java/me/bymartrixx/vtd/gui/widget/PackSelectionListWidget.java b/src/main/java/me/bymartrixx/vtd/gui/widget/PackSelectionListWidget.java index 00c1415..fbb4d5a 100644 --- a/src/main/java/me/bymartrixx/vtd/gui/widget/PackSelectionListWidget.java +++ b/src/main/java/me/bymartrixx/vtd/gui/widget/PackSelectionListWidget.java @@ -13,7 +13,6 @@ import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.gui.screen.narration.NarrationMessageBuilder; import net.minecraft.client.gui.screen.narration.NarrationPart; -import net.minecraft.client.gui.widget.ClickableWidget; import net.minecraft.client.gui.widget.list.EntryListWidget; import net.minecraft.client.sound.PositionedSoundInstance; import net.minecraft.client.sound.SoundManager; @@ -64,15 +63,15 @@ public class PackSelectionListWidget extends EntryListWidget= this.top && mouseY < this.bottom - && mouseX >= this.left && mouseX < this.right + if (mouseY >= this.getY() && mouseY < this.getYEnd() + && mouseX >= this.getX() && mouseX < this.getXEnd() && !this.screen.isCoveredByPopup(mouseX, mouseY)) { int width = this.getTooltipWidth(); for (AbstractEntry entry : this.children()) { @@ -381,7 +380,7 @@ public void renderTooltips(GuiGraphics graphics, int mouseX, int mouseY) { // endregion @Override - public void appendNarrations(NarrationMessageBuilder builder) { + public void updateNarration(NarrationMessageBuilder builder) { builder.put(NarrationPart.TITLE, Constants.RESOURCE_PACK_SCREEN_SUBTITLE); } diff --git a/src/main/java/me/bymartrixx/vtd/gui/widget/SelectedPacksListWidget.java b/src/main/java/me/bymartrixx/vtd/gui/widget/SelectedPacksListWidget.java index a6e4f1b..f052f2d 100644 --- a/src/main/java/me/bymartrixx/vtd/gui/widget/SelectedPacksListWidget.java +++ b/src/main/java/me/bymartrixx/vtd/gui/widget/SelectedPacksListWidget.java @@ -5,7 +5,6 @@ import me.bymartrixx.vtd.gui.VTDownloadScreen; import net.minecraft.client.MinecraftClient; import net.minecraft.client.gui.GuiGraphics; -import net.minecraft.client.gui.screen.Screen; import net.minecraft.client.gui.screen.narration.NarrationMessageBuilder; import net.minecraft.client.gui.screen.narration.NarrationPart; import net.minecraft.client.gui.widget.list.EntryListWidget; @@ -32,13 +31,13 @@ public class SelectedPacksListWidget extends EntryListWidget if (this.renderBackground) + // @see EntryListWidget#drawWidget -> if (this.renderBackground)[1] int size = HORIZONTAL_SHADOWS_SIZE; - graphics.fillGradient(RenderLayer.getGuiOverlay(), this.left, this.top, this.right, this.top + size, 0xFF000000, 0x00000000, 0); - graphics.fillGradient(RenderLayer.getGuiOverlay(), this.left, this.bottom - size, this.right, this.bottom, 0x00000000, 0xFF000000, 0); + graphics.fillGradient(RenderLayer.getGuiOverlay(), this.getX(), this.getY(), this.getXEnd(), this.getY() + size, 0xFF000000, 0x00000000, 0); + graphics.fillGradient(RenderLayer.getGuiOverlay(), this.getX(), this.getYEnd() - size, this.getXEnd(), this.getYEnd(), 0x00000000, 0xFF000000, 0); } // endregion @Override - public void appendNarrations(NarrationMessageBuilder builder) { + public void updateNarration(NarrationMessageBuilder builder) { builder.put(NarrationPart.TITLE, HEADER); } diff --git a/src/main/java/me/bymartrixx/vtd/mixin/PackEntryListWidgetMixin.java b/src/main/java/me/bymartrixx/vtd/mixin/PackEntryListWidgetMixin.java index d37ece0..6373ac7 100644 --- a/src/main/java/me/bymartrixx/vtd/mixin/PackEntryListWidgetMixin.java +++ b/src/main/java/me/bymartrixx/vtd/mixin/PackEntryListWidgetMixin.java @@ -31,8 +31,8 @@ public abstract class PackEntryListWidgetMixin extends AlwaysSelectedEntryListWi @Shadow @Final PackScreen screen; - private PackEntryListWidgetMixin(MinecraftClient minecraftClient, int i, int j, int k, int l, int m) { - super(minecraftClient, i, j, k, l, m); + private PackEntryListWidgetMixin(MinecraftClient client, int width, int height, int y, int itemHeight) { + super(client, width, height, y, itemHeight); } @Override diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 850c5c6..4df62a9 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -28,7 +28,7 @@ ], "depends": { - "minecraft": "~1.20.2" + "minecraft": "~1.20.4" }, "custom": {