Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/falkirks/chestrefill
Automated chest refilling for PocketMine
https://github.com/falkirks/chestrefill
pocketmine-plugins
Last synced: about 18 hours ago
JSON representation
Automated chest refilling for PocketMine
- Host: GitHub
- URL: https://github.com/falkirks/chestrefill
- Owner: falkirks
- License: mit
- Created: 2015-01-24T03:44:58.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-12-25T15:24:07.000Z (almost 8 years ago)
- Last Synced: 2024-09-26T10:21:36.996Z (about 18 hours ago)
- Topics: pocketmine-plugins
- Language: PHP
- Size: 19.5 KB
- Stars: 11
- Watchers: 7
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
ChestRefill
===========ChestRefill is powerful chest management plugin. When first released, ChestRefill allowed users to capture chest contents and refill them all on a timer. Now ChestRefill can do much more than that.
## API
ChestRefill comes with an easy to use API. This API allows other plugins to use portions of ChestRefill, modify existing features or simply simulate normal user interaction.### `ChestPattern`
Chest patterns define what happens when a chest is "refilled". They are loaded in a dynamic fashion and new ones can easily be injected. Each chest has it's one and only one `ChestPattern`.#### Example
Patterns must be declared in a certain structure.
```php
/**
* @pattern-name setALL
* @pattern-params {"id": "", "meta": "", "amount": ""}
*/
class SetAllPattern extends ChestPattern{
public function apply(){
// This method applies the pattern to the chest, chest can be accessed at $this->getChestTile()
}
public static function startWizard(CommandSender $sender, array $args, ChestRefill $main){
// This method is run when a CommandSender attempts to access pattern
}
}
```The above pattern could be registered by using
```php
$this->getServer()->getPluginManager()->getPlugin("ChestRefill")->getPatternStore()->addClass(SetAllPattern::class);
```
### `RefillDispatcher` (in progress)
Chest dispatchers are what cause chests' to be refilled. A dispatcher can have multiple chests and a chest can have multiple dispatchers.