Automate creation and deletion of Tiles for appropriate blocks

closes #880
This commit is contained in:
Dylan K. Taylor
2019-02-13 12:27:13 +00:00
parent 260c5dcf00
commit 01e7ebeb5c
13 changed files with 100 additions and 97 deletions

View File

@ -1869,6 +1869,11 @@ class Level implements ChunkManager, Metadatable{
if(!$hand->place($item, $blockReplace, $blockClicked, $face, $clickVector, $player)){
return false;
}
$tile = $this->getTile($hand);
if($tile !== null){
//TODO: seal this up inside block placement
$tile->copyDataFromItem($item);
}
if($playSound){
$this->broadcastLevelSoundEvent($hand, LevelSoundEventPacket::SOUND_PLACE, $hand->getRuntimeId());