This plugin adds the compatibility to add more blocks above the 255 ID in Pocketmine API 3
This plugin uses a Tile Entity which saves the registered blocks from another plugin (Soon config) and a Placeholder block which replaces the Reserved6 that makes instance with the block you want that uses PlaceholderTrait and gives info to the server.
It checks when a LevelChunkPacket is sent so the block would be valid and visible to the player that is within that chunk.
For now you would need to use another plugin that register the blocks itself.
For the blocks to be able to register correctly you must add use JavierLeon9966\ExtendedBlocks\block\PlaceholderTrait
in the block class.
Soon I'll be able to add blocks in a config. But for now it's just like a API plugin.
It's recommended to use this method when the plugin starts loading (onLoad
).
JavierLeon9966\ExtendedBlocks\block\BlockFactory::registerBlock($block)
That could happen if you made the class of the block wrong, this is the correct way:
class Sample extends Block{
use PlaceholderTrait;
protected $id = 526; //The id of the block
public function __construct(int $meta = 0){
$this->meta = $meta;
}
...
}