Download the PHP package cosmicpe/blockdata without Composer

On this page you can find all versions of the php package cosmicpe/blockdata. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package blockdata

BlockData

A PocketMine-MP virion that lets plugins set arbitrary data to blocks.

What's so special about BlockData?

  1. Multiple plugins can store data in the same block without overriding each other's data.
  2. BlockData never reads the database unless BlockDataWorld::getBlockDataAt() is called. So the block data isn't automatically cached when a chunk is loaded.
  3. yeahh..

Why don't you just store data in tiles?

Storing data in tiles is not a problem as long as the number of loaded tiles can be kept moderated. When a chunk loads, the server reads all tiles from the database and caches them. If you were to store block data for each block in a chunk using tiles, that's 65536 tile instances in the RAM! To avoid this, BlockData only loads data of blocks when explicitly requested to.

Are there any drawbacks?

  1. Since the virion has a strict policy on caching, a fresh call to BlockDataWorld::getBlockDataAt() would read the database synchronously. If this worries you, BlockData is backed by LevelDB and uses the snappy compression. A call to LevelDB::get() hardly takes a millisecond anyway. BlockData instances once created by the virion are cached until the chunk unloads.
  2. There's an inconsistency in deleting block => deleting data. This is due to the fact that blocks can be set by several different ways but there aren't the same number of ways to directly listen for block changes. Blocks can be changed using World::setBlockAt(), World::setChunk() or even when the plugin using this virion is disabled and the plugin will never know that the block was deleted, so the BlockData in such cases will exist well after the block has been deleted.
  3. Because BlockData doesn't autoload with chunks (unlike tiles), you can't efficiently write BlockData that's always ticking.

Developer Docs

Install with the Virion 3 standard:

The first thing your plugin will have to do to gain access to this virion's API is request a BlockDataWorldManager instance. BlockDataWorldManager maps BlockDataWorlds to pocketmine's worlds. BlockDataWorld provides an API to get and set BlockData.

Now lets create a BlockData class! BlockData is backed by nbt. (Honestly, might switch over to JSON but not sure if it's worth sacrificing binary-safe data storage).

And map it to a string identifier.

Wew, now all that's remaining is event handling!

Also check out BlockData-Example-Plugin.


All versions of blockdata with dependencies

PHP Build Version
Package Version
Requires pocketmine/pocketmine-mp Version ^5.0.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package cosmicpe/blockdata contains the following files

Loading the files please wait ....