build: add Spigot plugin foundation
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
package games.dmg.spigotharvest;
|
||||
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
/** Spigot Harvest plugin entry point. */
|
||||
public final class SpigotHarvestPlugin extends JavaPlugin {
|
||||
@Override
|
||||
public void onEnable() {
|
||||
// Feature services are registered by their corresponding user stories.
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
name: SpigotHarvest
|
||||
version: ${version}
|
||||
main: games.dmg.spigotharvest.SpigotHarvestPlugin
|
||||
api-version: "1.20"
|
||||
description: Progression-gated connected crop harvesting.
|
||||
author: dmg.games
|
||||
commands:
|
||||
harvest:
|
||||
description: View crop progression and manage harvest settings.
|
||||
usage: /harvest [status [crop]|bossbar <enable|disable>]
|
||||
harvestadmin:
|
||||
description: Administer Spigot Harvest progression.
|
||||
usage: /harvestadmin <subcommand>
|
||||
permission: spigotharvest.admin
|
||||
permissions:
|
||||
spigotharvest.admin:
|
||||
description: Allows administration of Spigot Harvest.
|
||||
default: op
|
||||
@@ -0,0 +1,29 @@
|
||||
package games.dmg.spigotharvest;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.util.Map;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.yaml.snakeyaml.Yaml;
|
||||
|
||||
final class PluginMetadataTest {
|
||||
@Test
|
||||
void declaresHarvestCommandsAndAdminPermission() {
|
||||
InputStream stream = getClass().getClassLoader().getResourceAsStream("plugin.yml");
|
||||
assertNotNull(stream);
|
||||
|
||||
Map<?, ?> plugin = new Yaml().load(stream);
|
||||
assertEquals("SpigotHarvest", plugin.get("name"));
|
||||
assertEquals("games.dmg.spigotharvest.SpigotHarvestPlugin", plugin.get("main"));
|
||||
assertEquals("1.20", plugin.get("api-version"));
|
||||
|
||||
Map<?, ?> commands = (Map<?, ?>) plugin.get("commands");
|
||||
assertNotNull(commands.get("harvest"));
|
||||
assertNotNull(commands.get("harvestadmin"));
|
||||
|
||||
Map<?, ?> permissions = (Map<?, ?>) plugin.get("permissions");
|
||||
assertNotNull(permissions.get("spigotharvest.admin"));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user