Skip to content

Commit

Permalink
Merge pull request #53 from YoungSoulluoS/master
Browse files Browse the repository at this point in the history
1.21.4
  • Loading branch information
enjarai authored Dec 22, 2024
2 parents 401beb6 + edb5fc1 commit cb23911
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 27 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
plugins {
id 'fabric-loom' version '1.8-SNAPSHOT'
id 'fabric-loom' version '1.9-SNAPSHOT'
id 'maven-publish'
id 'me.fallenbreath.yamlang' version '1.3.1'
id "me.modmuss50.mod-publish-plugin" version "0.4.4"
id "me.modmuss50.mod-publish-plugin" version "0.8.1"
}

sourceCompatibility = JavaVersion.VERSION_21
Expand Down
14 changes: 7 additions & 7 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,24 @@ org.gradle.jvmargs=-Xmx1G

# Fabric Properties
# check these on https://fabricmc.net/use
minecraft_version=1.21.3
yarn_mappings=1.21.3+build.2
minecraft_version=1.21.4
yarn_mappings=1.21.4+build.1
loader_version=0.16.9

# Mod Properties
mod_version=2.6.0
mod_version=2.7.0
maven_group=nl.enjarai
archives_base_name=recursive-resources

publish_target_min=1.21.2
publish_target_max=1.21.3
publish_target_min=1.21.4
publish_target_max=1.21.4
mod_modrinth=CcL3MXyI
mod_curseforge=674907
mod_github=enjarai/recursive-resources
git_branch=master

fabric_version=0.107.3+1.21.3
fabric_version=0.111.0+1.21.4
# https://modrinth.com/mod/modmenu/versions
modmenu_version=12.0.0-beta.1
modmenu_version=13.0.0-beta.1
shared_resources_version=1.8.0
cicada_version=0.9.1+1.21.2-and-above
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ protected void init() {
btn.setMessage(folderView ? VIEW_FOLDER : VIEW_FLAT);

refresh();
customAvailablePacks.setScrollAmount(0.0);
customAvailablePacks.setScrollY(0.0);
})
.dimensions(ButtonWidget.DEFAULT_WIDTH, ButtonWidget.DEFAULT_HEIGHT, ButtonWidget.DEFAULT_WIDTH, ButtonWidget.DEFAULT_HEIGHT)
.build()
Expand Down Expand Up @@ -258,14 +258,14 @@ private void onFiltersUpdated() {
customAvailablePacks.children().addAll(filteredPacks);
}

customAvailablePacks.setScrollAmount(customAvailablePacks.getScrollAmount());
customAvailablePacks.setScrollY(customAvailablePacks.getScrollY());
}

public void moveToFolder(Path folder) {
currentFolder = folder;
currentFolderMeta = FolderMeta.loadMetaFile(roots, currentFolder);
refresh();
customAvailablePacks.setScrollAmount(0.0);
customAvailablePacks.setScrollY(0.0);
}

// UI Overrides
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public boolean mouseClicked(double mouseX, double mouseY, int button) {
return true;
}

if (!this.widget.scrolling) {
if (!this.widget.scrollbarDragged) {
ownerScreen.moveToFolder(this.isUp ? this.rootFolder : this.folder);
}
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

@Mixin(EntryListWidget.class)
public abstract class EntryListWidgetMixin extends ContainerWidget {
Expand Down Expand Up @@ -45,11 +44,4 @@ public EntryListWidgetMixin(int i, int j, int k, int l, Text text) {
@Share("mouseX") LocalIntRef mouseXRef, @Share("mouseY") LocalIntRef mouseYRef) {
return true;
}

@Inject(
method = "clickedHeader",
at = @At("HEAD")
)
protected void recursiveresources$handleHeaderClick(int x, int y, CallbackInfoReturnable<Boolean> cir) {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.llamalad7.mixinextras.sugar.Share;
import com.llamalad7.mixinextras.sugar.ref.LocalIntRef;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.screen.StatsScreen;
import net.minecraft.client.gui.screen.pack.PackListWidget;
import net.minecraft.client.gui.screen.pack.PackScreen;
import net.minecraft.client.gui.widget.EntryListWidget;
Expand All @@ -14,14 +15,14 @@
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

import java.util.List;

@Mixin(PackListWidget.class)
public abstract class PackListWidgetMixin extends EntryListWidgetMixin implements FolderedPackListWidget {
@Shadow @Final PackScreen screen;
@Shadow public abstract int getRowWidth();

@Unique
@Nullable
private Text titleHoverText;
Expand Down Expand Up @@ -71,11 +72,26 @@ public PackListWidgetMixin(int i, int j, int k, int l, Text text) {

return true;
}


/**
* Reference
* {@link StatsScreen.ItemStatsListWidget#mouseClicked(double, double, int)}
* */
@SuppressWarnings("all") // Fix Inaccessible for javadocs
@Override
protected void recursiveresources$handleHeaderClick(int x, int y, CallbackInfoReturnable<Boolean> ci) {
public boolean mouseClicked(double mouseX, double mouseY, int button) {
boolean bl = super.mouseClicked(mouseX, mouseY, button);
return bl || this.clickedHeader(
(int) (mouseX - ((double) this.getX() + (double) this.width / 2.0 - (double) this.getRowWidth() / 2.0)),
(int) (mouseY - (double) this.getY()) + (int) this.getScrollY() - 4
);
}

@Unique
protected boolean clickedHeader(int x, int y) {
if (titleClickEvent != null && y <= client.textRenderer.fontHeight) {
titleClickEvent.run();
}
return true;
}
}
2 changes: 1 addition & 1 deletion src/main/resources/recursiveresources.accesswidener
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ accessible field net/minecraft/client/gui/screen/pack/ResourcePackOrganizer$
accessible field net/minecraft/resource/DirectoryResourcePack root Ljava/nio/file/Path;

# For scrolling fix
accessible field net/minecraft/client/gui/widget/EntryListWidget scrolling Z
accessible field net/minecraft/client/gui/widget/ScrollableWidget scrollbarDragged Z

# NEW!
accessible class net/minecraft/resource/ZipResourcePack$ZipFileWrapper

0 comments on commit cb23911

Please sign in to comment.