-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #171 from LostLuma/add-fastload-softlock-workaround
Add workaround for softlock in combination with Fastload
- Loading branch information
Showing
14 changed files
with
121 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 12 additions & 2 deletions
14
platforms/common/src/main/java/dynamic_fps/impl/service/ModCompat.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
platforms/common/src/main/java/dynamic_fps/impl/service/Platform.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
platforms/common/src/main/java/dynamic_fps/impl/util/ModCompatHelper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package dynamic_fps.impl.util; | ||
|
||
import dynamic_fps.impl.service.ModCompat; | ||
import dynamic_fps.impl.service.Platform; | ||
|
||
import java.util.Arrays; | ||
import java.util.Optional; | ||
|
||
public class ModCompatHelper { | ||
public static void init() { | ||
fixFastloadSoftLock(); | ||
} | ||
|
||
/** | ||
* Fix softlock in combination with Fastload <=3.4.0 due to our screen / loading overlay optimization. | ||
* | ||
* See the <a href="https://github.com/juliand665/Dynamic-FPS/issues/129">issue report</a> for more info. | ||
*/ | ||
private static void fixFastloadSoftLock() { | ||
Optional<String> optional = Platform.getInstance().getModVersion("fastload"); | ||
|
||
if (optional.isEmpty()) { | ||
return; | ||
} | ||
|
||
String[] parts = optional.get().split("\\."); | ||
int[] version = Arrays.stream(parts).mapToInt(Integer::parseInt).toArray(); | ||
|
||
if (version.length < 3) { | ||
Logging.getLogger().warn("Unable to parse Fastload version: {}!", optional.get()); | ||
return; | ||
} | ||
|
||
// If a version below 3.4.0 is present opt their custom world loading screen out of our optimization | ||
if (!(version[0] > 3 || version[0] == 3 && (version[1] > 4 || version[1] == 4 && version[2] > 0))) { | ||
ModCompat.getInstance().getOptedOutScreens().add( | ||
"io.github.bumblesoftware.fastload.client.BuildingTerrainScreen" | ||
); | ||
|
||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters