Download the PHP package valres/pmtoolbox without Composer
On this page you can find all versions of the php package valres/pmtoolbox. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download valres/pmtoolbox
More information about valres/pmtoolbox
Files in valres/pmtoolbox
Package pmtoolbox
Short Description Best utilities libs for PocketMine-MP plugins.
License MIT
Informations about the package pmtoolbox
PMToolBox
PMToolBox is a small PocketMine-MP toolbox library. It provides utilities for manager-based plugin structure, task helpers and an optional RCON interface.
Setup
Register the toolbox from your plugin lifecycle:
By default, managers are loaded from the manager directory under your plugin namespace.
If your managers are elsewhere:
If you do not want to use the manager system:
Managers
Create managers by extending BaseManager.
Dependencies
Use ManagerDependsOn when a manager must be initialized after another one.
The resolver detects duplicate manager names, missing dependencies and circular dependencies.
Auto Register
Managers can auto-register commands and listeners from folders next to the manager class.
Expected folder layout:
Access
You can also access the handler directly:
Each manager also behaves like a singleton automatically. You do not need to add a trait in your manager class:
The singleton instance is registered when the manager is discovered and reset when managers are disabled.
RCON
RCON is optional and can be started during enable:
Or with the helper:
Camera
Register the camera helper once during enable. PMToolBox will send the vanilla camera presets when a player finishes initializing.
Then build and send camera instructions fluently:
Sequences are useful when a plugin wants to group multiple instructions:
Data-Driven UI
PMToolBox includes an experimental DDUI helper inspired by Minecraft Bedrock's Data-Driven UI model and Joshet18/Data-DrivenUI. It is registered automatically by ToolboxLoader::enable().
For simple dialogs:
Supported DduiCustomForm controls are labels, spacers, dividers, text fields, toggles, dropdowns, sliders and buttons. DduiObservable values can be updated server-side while the screen is open; client-writable observables are updated when the player changes the matching control.
Packets
PMToolBox includes a small packet API inspired by LibPacket/SimplePacketHandler: register handlers for specific packet classes instead of writing long instanceof chains.
Monitor
Use a monitor when you only want to observe packets. Return values are ignored.
Interceptor
Use an interceptor when you want to cancel or modify packets before normal handling. Return false to cancel the packet event.
Handler Classes
Attributes
You can also register public methods with attributes.