duct tape for block ID remapping

This commit is contained in:
Dylan K. Taylor
2018-03-03 18:52:41 +00:00
parent c81f178cdb
commit 5ce55bd3b0
8 changed files with 72 additions and 22 deletions

View File

@ -907,14 +907,16 @@ class Level implements ChunkManager, Metadatable{
$pk->z = $b->z;
if($b instanceof Block){
$pk->blockId = $b->getId();
$pk->blockData = $b->getDamage();
$blockId = $b->getId();
$blockData = $b->getDamage();
}else{
$fullBlock = $this->getFullBlock($b->x, $b->y, $b->z);
$pk->blockId = $fullBlock >> 4;
$pk->blockData = $fullBlock & 0xf;
$blockId = $fullBlock >> 4;
$blockData = $fullBlock & 0xf;
}
$pk->blockRuntimeId = BlockFactory::toStaticRuntimeId($blockId, $blockData);
$pk->flags = $first ? $flags : UpdateBlockPacket::FLAG_NONE;
$packets[] = $pk;
@ -931,14 +933,16 @@ class Level implements ChunkManager, Metadatable{
$pk->z = $b->z;
if($b instanceof Block){
$pk->blockId = $b->getId();
$pk->blockData = $b->getDamage();
$blockId = $b->getId();
$blockData = $b->getDamage();
}else{
$fullBlock = $this->getFullBlock($b->x, $b->y, $b->z);
$pk->blockId = $fullBlock >> 4;
$pk->blockData = $fullBlock & 0xf;
$blockId = $fullBlock >> 4;
$blockData = $fullBlock & 0xf;
}
$pk->blockRuntimeId = BlockFactory::toStaticRuntimeId($blockId, $blockData);
$pk->flags = $flags;
$packets[] = $pk;
@ -1938,7 +1942,7 @@ class Level implements ChunkManager, Metadatable{
}
if($playSound){
$this->broadcastLevelSoundEvent($hand, LevelSoundEventPacket::SOUND_PLACE, 1, $hand->getId());
$this->broadcastLevelSoundEvent($hand, LevelSoundEventPacket::SOUND_PLACE, 1, BlockFactory::toStaticRuntimeId($hand->getId(), $hand->getDamage()));
}
$item->pop();