mirror of
https://github.com/plexusorg/plugin-yml.git
synced 2024-12-22 16:25:06 +00:00
Add Bukkit's new provides
field. (#8)
Commit adding this field: 9f2fd967a4 (src)
/main/java/org/bukkit/plugin/PluginDescriptionFile.java
This commit is contained in:
parent
2b2627e2db
commit
36ec001e8e
3 changed files with 7 additions and 0 deletions
|
@ -49,6 +49,7 @@ bukkit {
|
|||
loadBefore = ['BrokenPlugin']
|
||||
prefix = 'TEST'
|
||||
defaultPermission = 'OP' // 'TRUE', 'FALSE', 'OP' or 'NOT_OP'
|
||||
provides = ['TestPluginOldName', 'TestPlug']
|
||||
|
||||
commands {
|
||||
test {
|
||||
|
@ -106,6 +107,7 @@ bukkit {
|
|||
loadBefore = listOf("BrokenPlugin")
|
||||
prefix = "TEST"
|
||||
defaultPermission = BukkitPluginDescription.Permission.Default.OP // TRUE, FALSE, OP or NOT_OP
|
||||
provides = listOf("TestPluginOldName", "TestPlug")
|
||||
|
||||
commands {
|
||||
"test" {
|
||||
|
|
|
@ -60,6 +60,10 @@ class BukkitPlugin : PlatformPlugin<BukkitPluginDescription>("Bukkit", "plugin.y
|
|||
if (alias.contains(':')) throw InvalidPluginDescriptionException("Alias '$alias' of '${command.name}' cannot contain ':'")
|
||||
}
|
||||
}
|
||||
|
||||
if (description.provides?.all(VALID_NAME::matches) == false) {
|
||||
throw InvalidPluginDescriptionException("Invalid plugin provides name: all should match $VALID_NAME")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -47,6 +47,7 @@ class BukkitPluginDescription(project: Project) : Serializable {
|
|||
@JsonProperty("loadbefore") var loadBefore: List<String>? = null
|
||||
var prefix: String? = null
|
||||
@JsonProperty("default-permission") var defaultPermission: Permission.Default? = null
|
||||
var provides: List<String>? = null
|
||||
|
||||
// DSL provider for commands and permissions (not serialized)
|
||||
@Transient @JsonIgnore val commands: NamedDomainObjectContainer<Command> = project.container(Command::class.java)
|
||||
|
|
Loading…
Reference in a new issue