Added logging for invalid registry IDs

This commit is contained in:
Auxilor
2023-03-18 15:22:20 +00:00
parent 6d23cc7141
commit 70131a6cae

View File

@@ -40,7 +40,7 @@ public class Registry<T extends Registrable> {
*/
@NotNull
public T register(@NotNull final T element) {
Validate.isTrue(ID_PATTERN.matcher(element.getID()).matches(), "ID must match pattern: " + ID_PATTERN.pattern());
Validate.isTrue(ID_PATTERN.matcher(element.getID()).matches(), "ID must match pattern: " + ID_PATTERN.pattern() + " (was " + element.getID() + ")");
registry.put(element.getID(), element);