Skip to content

Commit

Permalink
Fixed a crash and bug
Browse files Browse the repository at this point in the history
  • Loading branch information
XyperCode committed Sep 29, 2023
1 parent aa26ee0 commit e56b1e3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import net.fabricmc.loader.api.FabricLoader;
import net.fabricmc.loader.api.ModContainer;
import net.fabricmc.loader.api.metadata.ModMetadata;
import net.fabricmc.loader.api.metadata.ModOrigin;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

Expand Down Expand Up @@ -170,12 +171,15 @@ public void run() {
this.progressAlt = new ProgressMessenger(msgAlt, allMods.size());
for (ModContainer container : allMods) {
progressAlt.sendNext(container.getMetadata().getName());
List<Path> paths = container.getOrigin().getPaths();
for (Path path : paths) {
try {
game().getResourceManager().importPackage(path);
} catch (IOException e) {
throw new RuntimeException(e);
ModOrigin origin = container.getOrigin();
if (origin.getKind() == ModOrigin.Kind.PATH) {
List<Path> paths = origin.getPaths();
for (Path path : paths) {
try {
game().getResourceManager().importPackage(path);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ public ListEntry(ObjectList<T> list, C value, int x, int y, int width, int heigh
}

public void render(Renderer renderer1, int mouseX, int mouseY, float deltaTime) {
this.list.entryRenderer.render(renderer1, list.width - SCROLLBAR_WIDTH, list.entryHeight, this.list.getViewport().yScroll + (list.entryHeight + list.gap) * index, value, list.selected == this && list.selectable, isHovered());
this.list.entryRenderer.render(renderer1, list.width - SCROLLBAR_WIDTH, list.entryHeight, -this.list.getViewport().yScroll + (list.entryHeight + list.gap) * index, value, list.selected == this && list.selectable, isHovered());
}

public void setIndex(int index) {
Expand Down

0 comments on commit e56b1e3

Please sign in to comment.