Virion Library | API Plugin | Example Plugin |
---|---|---|
プラグインから簡単にリソースパックを扱うためのツール(ライブラリ)
- Virionライブラリとして使用する
- APIプラグインとして使用する
plugin.phar(Plugin)/
├ resources/
│ ├ info.png
│ └ test/
│ └ server.png
└ src/
└ ...
test1.zip(ResourcePack)/
├ server.png
├ manifest.json
└ pack_icon.png
$pack = new SimpleResourcePack($this, new Version(1, 0, 0));
$pack->setPackIcon("info.png");
$pack->addFile("test/server.png", "server.png");
$pack->generate($this->getDataFolder() . "test1.zip");
ResourcePack::register($this->getDataFolder() . "test1.zip");
リソースパックの中身を変える時は、リソースパックのバージョンを上げてください。
例えばnew Version(1, 1, 0);
これは、一般的なリソースパック開発と同様です。
一度ダウンロードされたリソースパックはキャッシュされますが、バージョンを上げることによって再ダウンロードされます。
コマンド名 | 説明 | パラメータ | 権限 | エイリアス | プレイヤーのみ |
---|---|---|---|---|---|
resourcepack | リソースパックを管理する | --- | resourcepacktools.command.resourcepack | rp | いいえ |
resourcepack register | リソースパックを登録する | <ファイル名> | --- | r | いいえ |
resourcepack unregisterbyindex | リソースパックをindexから登録解除する | <index> | --- | urbi | いいえ |
resourcepack unregisterbyuuid | リソースパックをuuidから登録解除する | <uuid> | --- | urbu | いいえ |
resourcepack list | リソースパックのリストを表示する | pack(p):uuid(u) | --- | l | いいえ |
Tool (library) for easy use of resource packs from plugins
- Use as Virion library
- Use as API Plugin
plugin.phar(Plugin)/
├ resources/
│ ├ info.png
│ └ test/
│ └ server.png
└ src/
└ ...
test1.zip(ResourcePack)/
├ server.png
├ manifest.json
└ pack_icon.png
$pack = new SimpleResourcePack($this, new Version(1, 0, 0));
$pack->setPackIcon("info.png");
$pack->addFile("test/server.png", "server.png");
$pack->generate($this->getDataFolder() . "test1.zip");
ResourcePack::register($this->getDataFolder() . "test1.zip");
When changing the contents of the ResourcePack, please change the version of the ResourcePack.
e.g.new Version(1, 1, 0);
This is similar to general ResourcePack development.
ResourcePack that have been downloaded once will be cached, but will be re-downloaded by increasing the version.
command name | description | parameter | permission | alias | only player |
---|---|---|---|---|---|
resourcepack | Manage ResourcePack | --- | resourcepacktools.command.resourcepack | rp | no |
resourcepack register | Register the ResourcePack | <filename> | --- | r | no |
resourcepack unregisterbyindex | Unregister the ResourcePack by index | <index> | --- | urbi | no |
resourcepack unregisterbyuuid | Unregister the ResourcePack by uuid | <uuid> | --- | urbu | no |
resourcepack list | Show the ResourcePack list | pack(p):uuid(u) | --- | l | no |