mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-13 00:37:52 +00:00
Fix corrupted and invalidly symlinked worlds crashing on level select (#10406)
This commit is contained in:
1 parent
1ea7ce9831
commit
dcafb4f633
2 files changed
+40
-7
No files matched your search
@@ -0,0 +1,22 @@
|
||||
package net.minecraftforge.common.extensions;
|
||||
|
||||
import net.minecraft.world.level.storage.LevelSummary;
|
||||
|
||||
public interface IForgeLevelSummary {
|
||||
private LevelSummary self() {
|
||||
return (LevelSummary) this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the Forge lifecycle of this level is experimental. This is used to render the experimental warning
|
||||
* tooltip on the level select screen.
|
||||
*
|
||||
* @return {@code true} if the level is experimental
|
||||
*/
|
||||
default boolean isLifecycleExperimental() {
|
||||
// NOTE: Because CorruptedLevelSummary and SymlinkLevelSummary can have null settings, we need to check it
|
||||
var settings = this.self().getSettings();
|
||||
|
||||
return settings != null && settings.getLifecycle().equals(com.mojang.serialization.Lifecycle.experimental());
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user