mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 19:02:59 +00:00
Added Block->getRuntimeId(), clean up some mess
This commit is contained in:
@ -874,16 +874,12 @@ class Level implements ChunkManager, Metadatable{
|
||||
$pk->z = $b->z;
|
||||
|
||||
if($b instanceof Block){
|
||||
$blockId = $b->getId();
|
||||
$blockData = $b->getDamage();
|
||||
$pk->blockRuntimeId = $b->getRuntimeId();
|
||||
}else{
|
||||
$fullBlock = $this->getFullBlock($b->x, $b->y, $b->z);
|
||||
$blockId = $fullBlock >> 4;
|
||||
$blockData = $fullBlock & 0xf;
|
||||
$pk->blockRuntimeId = BlockFactory::toStaticRuntimeId($fullBlock >> 4, $fullBlock & 0xf);
|
||||
}
|
||||
|
||||
$pk->blockRuntimeId = BlockFactory::toStaticRuntimeId($blockId, $blockData);
|
||||
|
||||
$pk->flags = $first ? $flags : UpdateBlockPacket::FLAG_NONE;
|
||||
|
||||
$packets[] = $pk;
|
||||
@ -900,16 +896,12 @@ class Level implements ChunkManager, Metadatable{
|
||||
$pk->z = $b->z;
|
||||
|
||||
if($b instanceof Block){
|
||||
$blockId = $b->getId();
|
||||
$blockData = $b->getDamage();
|
||||
$pk->blockRuntimeId = $b->getRuntimeId();
|
||||
}else{
|
||||
$fullBlock = $this->getFullBlock($b->x, $b->y, $b->z);
|
||||
$blockId = $fullBlock >> 4;
|
||||
$blockData = $fullBlock & 0xf;
|
||||
$pk->blockRuntimeId = BlockFactory::toStaticRuntimeId($fullBlock >> 4, $fullBlock & 0xf);
|
||||
}
|
||||
|
||||
$pk->blockRuntimeId = BlockFactory::toStaticRuntimeId($blockId, $blockData);
|
||||
|
||||
$pk->flags = $flags;
|
||||
|
||||
$packets[] = $pk;
|
||||
@ -1866,7 +1858,7 @@ class Level implements ChunkManager, Metadatable{
|
||||
}
|
||||
|
||||
if($playSound){
|
||||
$this->broadcastLevelSoundEvent($hand, LevelSoundEventPacket::SOUND_PLACE, 1, BlockFactory::toStaticRuntimeId($hand->getId(), $hand->getDamage()));
|
||||
$this->broadcastLevelSoundEvent($hand, LevelSoundEventPacket::SOUND_PLACE, 1, $hand->getRuntimeId());
|
||||
}
|
||||
|
||||
$item->pop();
|
||||
|
Reference in New Issue
Block a user