-
-
Notifications
You must be signed in to change notification settings - Fork 341
[API8] Add datapack support #1706
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
a0b710e
Add resource manager for data packs
mattmess1221 8e0fc0e
Resource.getReader now returns a BufferedReader
mattmess1221 cb2f431
ResourcePath is iterable on it's parents
mattmess1221 2efe859
Fixup some javadoc
mattmess1221 84a1b55
Add some filename related methods
mattmess1221 aa40cf5
Add some methods to ResourceReloadEvent.Pre for manipulating the pack…
mattmess1221 425b94e
Add a method in Pack.Builder for providing from a file
mattmess1221 12cc2f6
Rework the resource system to be more inline with vanilla.
mattmess1221 abd3024
Add a PackRepository and PackInfo. The PackInfo is used to get the Pack,
mattmess1221 58020b5
Update some javadocs and modify a few methods
mattmess1221 0cf1c83
Add resourcetype argument to PluginContainer.getPack()
mattmess1221 2a78632
Change for 1.14
mattmess1221 30fe7de
Fix the build
mattmess1221 1052aab
Fix some rebase artifacts
mattmess1221 84cf0d9
AsyncReloader had too much impl.
mattmess1221 309d66e
Pack should be closeable.
mattmess1221 d6dc2a0
Fixes to javadocs and nitpicks
mattmess1221 a47186a
Change PackTypes.ASSETS to RESOURCES
mattmess1221 b124bb8
Remove the assets package.
mattmess1221 f540f2b
Fix some nitpicks
mattmess1221 fcfb76c
Remove WillNotClose from Resource copy.
mattmess1221 b195b1d
Change getInputStream javadoc to represent current code.
mattmess1221 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 was deleted.
Oops, something went wrong.
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -22,39 +22,34 @@ | |
| * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
| * THE SOFTWARE. | ||
| */ | ||
| package org.spongepowered.api.asset; | ||
| package org.spongepowered.api.event.resource; | ||
|
|
||
| import org.spongepowered.api.plugin.Plugin; | ||
| import org.spongepowered.api.plugin.PluginContainer; | ||
|
|
||
| import java.util.Optional; | ||
| import org.spongepowered.api.Engine; | ||
| import org.spongepowered.api.event.Event; | ||
| import org.spongepowered.api.resource.ResourceManager; | ||
|
|
||
| /** | ||
| * The AssetManager offers a convenient way to easily retrieve resources from | ||
| * Sponge {@link Plugin}s. The asset manager will attempt to find the | ||
| * asset of the specified name at: <code>assets/<plugin_id></code> | ||
| * Base class for events related to resources. | ||
| */ | ||
| public interface AssetManager { | ||
| public interface ResourceEvent extends Event { | ||
|
|
||
| /** | ||
| * Gets the engine of the resources | ||
| * @return The engine | ||
| */ | ||
| Engine getEngine(); | ||
|
|
||
| /** | ||
| * Returns the {@link Asset} of the specified name for the specified | ||
| * {@link Plugin} instance. | ||
| * | ||
| * @param plugin Plugin instance | ||
| * @param name Name of resource to retrieve | ||
| * @return Asset if present, empty otherwise | ||
| * Gets the {@link ResourceManager}. | ||
| * @return The resource manager | ||
| */ | ||
| Optional<Asset> getAsset(PluginContainer plugin, String name); | ||
| ResourceManager getResourceManager(); | ||
|
|
||
| /** | ||
| * Returns the {@link Asset} of the specified name within the domain of the | ||
| * implementation. This method will typically call | ||
| * {@link #getAsset(PluginContainer, String)} using a dummy | ||
| * {@link PluginContainer} for the SpongeAPI implementation. | ||
| * | ||
| * @param name Name of resource to retrieve | ||
| * @return Asset if present, empty otherwise | ||
| * Fired after a {@link ResourceManager} has been reloaded. This can be | ||
| * used to reload some systems that are resource based. | ||
| */ | ||
| Optional<Asset> getAsset(String name); | ||
| interface Reload extends ResourceEvent { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please allow plugins to work async! This will increase load on the server and cannot be profiled by vanilla loading bar, etc. |
||
|
|
||
| } | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.