By continuing to use this site, you agree to the Terms of Service of this website, including usage of cookies.
OK, Don't show this again
This plugin adds the compatibility to add more blocks above the 255 ID in Pocketmine API 3.0.0+
WARNINGS
To update this plugin safely you must stop your server and install the updated version, then you can start the server again.
This plugin uses a Tile Entity which saves the registered blocks from another plugin 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 and finds every tile within the chunk that is a Placeholder block and sends the block to the player.
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 this trait in the block class:
use JavierLeon9966\ExtendedBlocks\block\PlaceholderTrait;
Soon It'll be able to add new blocks in a configuration, but for now it's just like a API plugin.
It's recommended to use this methods when the plugin starts loading:
use pocketmine\block\BlockFactory;
use pocketmine\item\ItemBlock;
use pocketmine\plugin\PluginBase;
use JavierLeon9966\ExtendedBlocks\item\ItemFactory;
class Plugin extends PluginBase{
public function onLoad(){
BlockFactory::registerBlock($block);
ItemFactory::addCreativeItem(ItemFactory::get(255 - $block->getId())); //Usually most blocks
}
...
}
This is a example of how your class must look for it to work properly
use pocketmine\block\Block; //You can extend any class but be a Block
use JavierLeon9966\ExtendedBlocks\block\PlaceholderTrait;
class Sample extends Block{
use PlaceholderTrait;
protected $id = 526; //The id of the block must be positive
public function __construct(int $meta = 0){ //Optional
$this->meta = $meta;
}
...
}
Reply to review by :
You can leave one review per plugin release, and delete or update your review at any time