nhanaz/libregrsp

This package is abandoned and no longer maintained. No replacement package was suggested.

Resource pack register library for PocketMine plugins

Maintainers

Package info

github.com/NhanAZ-Libraries/libRegRsp

pkg:composer/nhanaz/libregrsp

Statistics

Installs: 24

Dependents: 0

Suggesters: 0

Stars: 4

Open Issues: 0

dev-master 2026-03-25 13:41 UTC

This package is auto-updated.

Last update: 2026-03-25 13:43:03 UTC


README

Resource-pack compile & register helper for PocketMine-MP (virion or composer library).

Features

  • Build .mcpack directly from your plugin resources/.
  • Supports both layouts: default <PluginName>/ and legacy "<PluginName> Pack"/.
  • Registers the pack at the top of the stack and removes duplicates (same UUID/path) first.
  • Optional forceRequired to require players to accept the pack.

Requirements

  • PocketMine-MP API 5.x
  • PHP 8.1+

Installation

Composer (self-hosted plugin)

composer require nhanaz/libregrsp

Poggit (virion)

Add to .poggit.yml:

projects:
  YourPlugin:
    libs:
      - src: NhanAZ/libRegRsp/libRegRsp
        version: ^1.0.4

Quick start

use NhanAZ\libRegRsp\libRegRsp;

class MyPlugin extends PluginBase {
    protected function onEnable() : void{
        // Resources under resources/MyPlugin/ or resources/MyPlugin Pack/
        libRegRsp::compileAndRegister($this);
    }

    protected function onDisable() : void{
        libRegRsp::unregister($this); // removes the .mcpack
    }
}

API reference (concise)

  • Build only: libRegRsp::compile($plugin, ?string $packFolder = null, ?string $zipFileName = null): ?string
  • Register only: libRegRsp::register($plugin, ?string $zipPath = null, bool $forceRequired = true): void
  • Unregister + delete: libRegRsp::unregister($plugin, ?string $zipPath = null): void

$packFolder defaults to plugin name; legacy "<PluginName> Pack"/ is auto-detected when no custom folder is provided.

Troubleshooting

  • Cannot create data folder: check write permissions of plugins/YourPlugin/.
  • Empty zip: ensure assets are in resources/<PluginName>/... or resources/<PluginName> Pack/.
  • Duplicate UUID: library already evicts duplicates before insert; if it persists, other packs likely share the same UUID.

License & Contact