-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix crash when accessing modlist too early
- Loading branch information
Showing
5 changed files
with
60 additions
and
5 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
Common/src/main/java/dev/upcraft/sparkweave/client/render/RenderDocHelper.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
37 changes: 37 additions & 0 deletions
37
Common/src/main/java/dev/upcraft/sparkweave/platform/SimpleModContainer.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,37 @@ | ||
package dev.upcraft.sparkweave.platform; | ||
|
||
import dev.upcraft.sparkweave.api.platform.ModContainer; | ||
import dev.upcraft.sparkweave.api.platform.ModMetadata; | ||
|
||
import java.nio.file.Path; | ||
import java.util.List; | ||
import java.util.Optional; | ||
import java.util.function.Function; | ||
|
||
public class SimpleModContainer implements ModContainer { | ||
|
||
private final ModMetadata metadata; | ||
private final List<Path> rootPaths; | ||
private final Function<String, Optional<Path>> pathFinder; | ||
|
||
public SimpleModContainer(ModMetadata metadata, List<Path> rootPaths, Function<String, Optional<Path>> pathFinder) { | ||
this.metadata = metadata; | ||
this.rootPaths = rootPaths; | ||
this.pathFinder = pathFinder; | ||
} | ||
|
||
@Override | ||
public ModMetadata metadata() { | ||
return metadata; | ||
} | ||
|
||
@Override | ||
public List<Path> rootPaths() { | ||
return rootPaths; | ||
} | ||
|
||
@Override | ||
public Optional<Path> findPath(String path) { | ||
return pathFinder.apply(path); | ||
} | ||
} |
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