Skip to content
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

Change mod ID regex to allow '.' in mod IDs #203

Merged
merged 4 commits into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
public class ModInfo implements IModInfo, IConfigurable {
private static final Logger LOGGER = LogUtils.getLogger();
private static final DefaultArtifactVersion DEFAULT_VERSION = new DefaultArtifactVersion("1");
private static final Pattern VALID_MODID = Pattern.compile("^[a-z][a-z0-9_]{1,63}$");
private static final Pattern VALID_MODID = Pattern.compile("^(?=.{2,64}$)[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)*$");
private static final Pattern VALID_NAMESPACE = Pattern.compile("^[a-z][a-z0-9_.-]{1,63}$");
private static final Pattern VALID_VERSION = Pattern.compile("^\\d+.*");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ public interface IModInfo {
*/
IModLanguageLoader getLoader();

/**
* {@return the mod id}
* Mod IDs must satisfy the following requirements:
* <ul>
* <li>be from 2 to 64 characters long
* <li>contain only lowercase letters, digits, underscores, and periods
* <li>each dot-separated section must start with a lowercase letter
* </ul>
*/
String getModId();

String getDisplayName();
Expand Down