https://github.com/jasonw4331/libefficientwe
A library for efficient world editing operations on PocketMine servers
https://github.com/jasonw4331/libefficientwe
php pocketmine pocketmine-mp poggit-virion
Last synced: 3 months ago
JSON representation
A library for efficient world editing operations on PocketMine servers
- Host: GitHub
- URL: https://github.com/jasonw4331/libefficientwe
- Owner: jasonw4331
- License: lgpl-3.0
- Created: 2021-03-09T01:18:26.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-01-18T20:28:38.000Z (over 1 year ago)
- Last Synced: 2024-10-09T14:40:56.240Z (8 months ago)
- Topics: php, pocketmine, pocketmine-mp, poggit-virion
- Language: PHP
- Homepage:
- Size: 255 KB
- Stars: 4
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# libEfficientWE
[](https://poggit.pmmp.io/ci/jasonwynn10/libEfficientWE/libEfficientWE)
A library for efficient world editing operations on PocketMine servers
## Usage
This viron was made for developers to efficiently edit large areas of blocks in a world without causing lag.
*NOTE*: This library does not handle undo/redo operations, that is up to the developer to implement.### API
#### Creating a shape
The following methods are used to create a shape object:
```php
$cuboid = Cuboid::fromAABB(new AxisAlignedBB($x1, $y1, $z1, $x2, $y2, $z2));
$cuboid2 = Cuboid::fromVector($vector1, $vector2);
```#### Executing a block operation
The following methods are used to execute a block operation object:
```php
/** @var Shape $shape */
$shape->copy($world, $x, $y, $z);
$shape->rotate($world, $x, $y, $z, $axis, $degrees);
```## Limitations
This library operates using morton codes meaning that it is limited to 21 bit integers for the x, y, and z coordinates.
This means that the absolute maximum number of blocks can operate on for any one axis is 2^20 - 1 or 1048575 before indexing collisions begin to occur.
This should not be an issue for most world editing plugins due to the requirement of user input, but it is something to be aware of and to test for in your plugin.