Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sollace/iaf
Fixes a recursive crash when updating Minecraft's advancements
https://github.com/sollace/iaf
Last synced: about 1 month ago
JSON representation
Fixes a recursive crash when updating Minecraft's advancements
- Host: GitHub
- URL: https://github.com/sollace/iaf
- Owner: Sollace
- License: mit
- Created: 2023-08-15T20:16:41.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-08-15T20:21:13.000Z (over 1 year ago)
- Last Synced: 2024-10-15T06:29:38.453Z (3 months ago)
- Language: Java
- Size: 62.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Infinite Advancements Fix (IAF)
![License](https://img.shields.io/github/license/Sollace/IAF)
![](https://img.shields.io/badge/api-fabric-orange.svg)This mod memely exists to fix a vanilla bug in 1.19.2 that prevents the game from loading with more than a certain
amount of advancements.## The Problem
In 1.19.2 vanilla, Mojang coded advancements to update their visibility using a recursive method (PlayerAdvancementTracker#updateDisplay).
In this class, they iterate through every advancement that has changed/needs updating, and they call updateDisplay on it.
Update display then, after doing its work, recursively calls itself on the advancement's parent and its children,
to propagate changes across the tree as needed.This method of updating the tree is perfectly reasonable for smaller datasets, like what Mojang has in vanilla, but as soon as you get
into larger modpacks that adds hundreds, maybe thousands, of advancements, as soon as players start unlocking those advancements,
they will eventually run into issues that will cause the game to crash with a stackoverflow exception any time they try to join that world.## The Fix
The fix is pretty obvious (if you're me): Don't use recursion.
So that's what I did. (and that's what Mojang did in 1.20 :P)
I've replaced the original recursive method calls with an iterative loop and a stack, and done it carefully to preserve the old behaviour
and (hopefully) retain compatibility with Architectury and Create (both of which have injection points into the start of this method).