-
Notifications
You must be signed in to change notification settings - Fork 12
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
Minecraft 1.13 - Datapacks #53
base: 1.12
Are you sure you want to change the base?
Conversation
Stream<LanternResource> stream = null; | ||
try { | ||
// If a wildcard is used, there is some special handling required | ||
if (path1.getNamespace().isEmpty()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will never be empty. If the namespace is omitted from vanilla, minecraft
is used in its place.
e.g. :.
will become minecraft:.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could modify that behavior? Or use a wildcard like *
instead.
final Matcher matcher = NAMESPACE_PATH_PATTERN.matcher(path); | ||
checkState(matcher.matches(), | ||
"%s doesn't match the namespaced path pattern: %s", path, NAMESPACE_PATH_PATTERN.pattern()); | ||
this.namespace = matcher.group(1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does this handle a non-existent namespace? By non-existent, I mean missing, which should default to minecraft
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Non existent would be path/to/file
, wildcard namespace :path/to/file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't currently implemented path/to/file
support
Implementing the WIP datapacks API
SpongePowered/SpongeAPI#1706
Different kind of paths:
path/to/file.txt
The namespace is unknown and will default tominecraft:path/to/file.txt
path/to/directory
The namespace is unknown and will default tominecraft:path/to/directory
:path/to/file.txt
(*:path/to/file.txt
) The namespace is a wildcard, alternatively use*
as namespace. Matches the first/all the files with the given path for every available namespace.:path/to/directory
(*:path/to/directory
) The namespace is a wildcard, alternatively use*
as namespace. Matches the all the files within the given directory for every available namespace.namespace:path/to/file.txt
A regular namespaced file path.namespace:path/to/directory
A regular namespaced directory path.