mirror of
https://github.com/YouHaveTrouble/BlockEdit.git
synced 2026-06-29 13:36:19 +00:00
prevent registration of "file" provider as it's special case
This commit is contained in:
@@ -48,6 +48,10 @@ public class SchematicHandler<S extends Schematic> {
|
|||||||
throw new SchematicHandlerRegistrationException("Schematic provider name can only contain lowercase letters and numbers", schematicProvider);
|
throw new SchematicHandlerRegistrationException("Schematic provider name can only contain lowercase letters and numbers", schematicProvider);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (schematicProviderName.equals("file")) {
|
||||||
|
throw new SchematicHandlerRegistrationException("Schematic provider name cannot be 'file'", schematicProvider);
|
||||||
|
}
|
||||||
|
|
||||||
if (schematicProvidersByName.containsKey(schematicProviderName)) {
|
if (schematicProvidersByName.containsKey(schematicProviderName)) {
|
||||||
throw new SchematicHandlerRegistrationException("Schematic provider with name " + schematicProvider.name() + " is already registered", schematicProvider);
|
throw new SchematicHandlerRegistrationException("Schematic provider with name " + schematicProvider.name() + " is already registered", schematicProvider);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user