Implemented Paintings (#2073)

This supports vanilla placement of paintings, with overlap and collision checking.
Paintings are removed when a block is placed inside them or if any of their supporting blocks are removed.

As per vanilla, a random painting is chosen from the largest subset that will fit into the given space.
This commit is contained in:
Dylan K. Taylor
2018-03-07 09:03:30 +00:00
committed by GitHub
parent c5336776a5
commit c7f8796136
6 changed files with 538 additions and 95 deletions

View File

@ -30,6 +30,8 @@ use pocketmine\block\Block;
use pocketmine\block\BlockFactory;
use pocketmine\block\Water;
use pocketmine\entity\object\ExperienceOrb;
use pocketmine\entity\object\Painting;
use pocketmine\entity\object\PaintingMotive;
use pocketmine\entity\projectile\Arrow;
use pocketmine\entity\projectile\Egg;
use pocketmine\entity\projectile\Snowball;
@ -231,6 +233,7 @@ abstract class Entity extends Location implements Metadatable, EntityIds{
Entity::registerEntity(ExperienceOrb::class, false, ['XPOrb', 'minecraft:xp_orb']);
Entity::registerEntity(FallingSand::class, false, ['FallingSand', 'minecraft:falling_block']);
Entity::registerEntity(Item::class, false, ['Item', 'minecraft:item']);
Entity::registerEntity(Painting::class, false, ['Painting', 'minecraft:painting']);
Entity::registerEntity(PrimedTNT::class, false, ['PrimedTnt', 'PrimedTNT', 'minecraft:tnt']);
Entity::registerEntity(Snowball::class, false, ['Snowball', 'minecraft:snowball']);
Entity::registerEntity(Squid::class, false, ['Squid', 'minecraft:squid']);
@ -241,6 +244,7 @@ abstract class Entity extends Location implements Metadatable, EntityIds{
Attribute::init();
Effect::init();
PaintingMotive::init();
}