presentkim / inner-addons
Register resource packs from plugin resources for axolotl-pm/PocketMine-MP
Requires
- php: ^8.4
- ext-zip: *
- adhocore/json-comment: ^1.2
- pocketmine/pocketmine-mp: ^5.0
- ramsey/uuid: ^4.7
Requires (Dev)
- axolotl-pm/pocketmine-mp: ^5.51
- phpunit/phpunit: ^12.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
inner-addons
This library has moved to presentkim/resourcepack-register.
📦 Moved to resourcepack-register
inner-addons was a one-method subset of resourcepack-register,
which does the same job and more: a zip kept in resource_packs/ is reused while the pack folder is unchanged,
packs can be built in memory without leaving a file, unregistered, or built from any directory.
This repository is archived and presentkim/inner-addons gets no more updates. 3.0.0 keeps working as it is.
composer remove presentkim/inner-addons composer require presentkim/resourcepack-register
🔁 Replacements
| inner-addons 3.0.0 | resourcepack-register 2.1+ |
|---|---|
use kim\present\inneraddons\InnerAddons; |
use kim\present\register\resourcepack\ResourcePackRegister; |
InnerAddons::register($this) |
ResourcePackRegister::registerFromResource($this, "addons", false) |
InnerAddons::register($this, "other_pack") |
ResourcePackRegister::registerFromResource($this, "other_pack", false) |
InnerAddons::register($this, "addons", $manager) |
ResourcePackRegister::registerFromResource($this, "addons", false, $manager) |
Returns ResourcePack |
Returns ResourcePack as well |
false writes the zip to resource_packs/ as inner-addons did, so it is not rebuilt on every start. Leave it out
(true, the default) to build the pack in memory without writing a file.
Differences to check
-
File name: the zip is
resource_packs/_resourcepack-register.<PluginName>.addons.zipinstead ofresource_packs/_inner.<uuid>.zip. Delete the old_inner.<uuid>.zipfrom servers that used inner-addons. -
Already registered UUID: inner-addons logged a warning and returned the registered pack. resourcepack-register throws
InvalidArgumentException; catch it if the pack may be registered twice:try{ ResourcePackRegister::registerFromResource($this, "addons", false); }catch(\InvalidArgumentException $e){ $this->getLogger()->warning($e->getMessage()); }
-
Errors: a missing folder, a missing or broken
manifest.jsonand a zip that cannot be written throwpocketmine\resourcepacks\ResourcePackExceptionin both.
📄 License
Distributed under the MIT License. See LICENSE for more information.