mirror of
https://github.com/plexusorg/plugin-yml.git
synced 2024-12-22 08:15:08 +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']
|
loadBefore = ['BrokenPlugin']
|
||||||
prefix = 'TEST'
|
prefix = 'TEST'
|
||||||
defaultPermission = 'OP' // 'TRUE', 'FALSE', 'OP' or 'NOT_OP'
|
defaultPermission = 'OP' // 'TRUE', 'FALSE', 'OP' or 'NOT_OP'
|
||||||
|
provides = ['TestPluginOldName', 'TestPlug']
|
||||||
|
|
||||||
commands {
|
commands {
|
||||||
test {
|
test {
|
||||||
|
@ -106,6 +107,7 @@ bukkit {
|
||||||
loadBefore = listOf("BrokenPlugin")
|
loadBefore = listOf("BrokenPlugin")
|
||||||
prefix = "TEST"
|
prefix = "TEST"
|
||||||
defaultPermission = BukkitPluginDescription.Permission.Default.OP // TRUE, FALSE, OP or NOT_OP
|
defaultPermission = BukkitPluginDescription.Permission.Default.OP // TRUE, FALSE, OP or NOT_OP
|
||||||
|
provides = listOf("TestPluginOldName", "TestPlug")
|
||||||
|
|
||||||
commands {
|
commands {
|
||||||
"test" {
|
"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 (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
|
@JsonProperty("loadbefore") var loadBefore: List<String>? = null
|
||||||
var prefix: String? = null
|
var prefix: String? = null
|
||||||
@JsonProperty("default-permission") var defaultPermission: Permission.Default? = null
|
@JsonProperty("default-permission") var defaultPermission: Permission.Default? = null
|
||||||
|
var provides: List<String>? = null
|
||||||
|
|
||||||
// DSL provider for commands and permissions (not serialized)
|
// DSL provider for commands and permissions (not serialized)
|
||||||
@Transient @JsonIgnore val commands: NamedDomainObjectContainer<Command> = project.container(Command::class.java)
|
@Transient @JsonIgnore val commands: NamedDomainObjectContainer<Command> = project.container(Command::class.java)
|
||||||
|
|
Loading…
Reference in a new issue