mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 09:56:06 +00:00
BlockTranslator: use less ambiguous function names
This commit is contained in:
@ -1074,7 +1074,7 @@ class World implements ChunkManager{
|
||||
|
||||
$tile = $this->getTileAt($b->x, $b->y, $b->z);
|
||||
if($tile instanceof Spawnable && count($fakeStateProperties = $tile->getRenderUpdateBugWorkaroundStateProperties($fullBlock)) > 0){
|
||||
$originalStateData = $blockTranslator->toStateData($fullBlock->getStateId());
|
||||
$originalStateData = $blockTranslator->internalIdToNetworkStateData($fullBlock->getStateId());
|
||||
$fakeStateData = new BlockStateData(
|
||||
$originalStateData->getName(),
|
||||
array_merge($originalStateData->getStates(), $fakeStateProperties),
|
||||
@ -1089,7 +1089,7 @@ class World implements ChunkManager{
|
||||
}
|
||||
$packets[] = UpdateBlockPacket::create(
|
||||
$blockPosition,
|
||||
$blockTranslator->toRuntimeId($fullBlock->getStateId()),
|
||||
$blockTranslator->internalIdToNetworkId($fullBlock->getStateId()),
|
||||
UpdateBlockPacket::FLAG_NETWORK,
|
||||
UpdateBlockPacket::DATA_LAYER_NORMAL
|
||||
);
|
||||
|
@ -34,6 +34,6 @@ class BlockBreakParticle implements Particle{
|
||||
public function __construct(private Block $b){}
|
||||
|
||||
public function encode(Vector3 $pos) : array{
|
||||
return [LevelEventPacket::create(LevelEvent::PARTICLE_DESTROY, TypeConverter::getInstance()->getBlockTranslator()->toRuntimeId($this->b->getStateId()), $pos)];
|
||||
return [LevelEventPacket::create(LevelEvent::PARTICLE_DESTROY, TypeConverter::getInstance()->getBlockTranslator()->internalIdToNetworkId($this->b->getStateId()), $pos)];
|
||||
}
|
||||
}
|
||||
|
@ -39,6 +39,6 @@ class BlockPunchParticle implements Particle{
|
||||
){}
|
||||
|
||||
public function encode(Vector3 $pos) : array{
|
||||
return [LevelEventPacket::create(LevelEvent::PARTICLE_PUNCH_BLOCK, TypeConverter::getInstance()->getBlockTranslator()->toRuntimeId($this->block->getStateId()) | ($this->face << 24), $pos)];
|
||||
return [LevelEventPacket::create(LevelEvent::PARTICLE_PUNCH_BLOCK, TypeConverter::getInstance()->getBlockTranslator()->internalIdToNetworkId($this->block->getStateId()) | ($this->face << 24), $pos)];
|
||||
}
|
||||
}
|
||||
|
@ -95,7 +95,7 @@ class FloatingTextParticle implements Particle{
|
||||
EntityMetadataProperties::BOUNDING_BOX_WIDTH => new FloatMetadataProperty(0.0),
|
||||
EntityMetadataProperties::BOUNDING_BOX_HEIGHT => new FloatMetadataProperty(0.0),
|
||||
EntityMetadataProperties::NAMETAG => new StringMetadataProperty($name),
|
||||
EntityMetadataProperties::VARIANT => new IntMetadataProperty(TypeConverter::getInstance()->getBlockTranslator()->toRuntimeId(VanillaBlocks::AIR()->getStateId())),
|
||||
EntityMetadataProperties::VARIANT => new IntMetadataProperty(TypeConverter::getInstance()->getBlockTranslator()->internalIdToNetworkId(VanillaBlocks::AIR()->getStateId())),
|
||||
EntityMetadataProperties::ALWAYS_SHOW_NAMETAG => new ByteMetadataProperty(1),
|
||||
];
|
||||
$p[] = AddActorPacket::create(
|
||||
|
@ -33,6 +33,6 @@ class TerrainParticle implements Particle{
|
||||
public function __construct(private Block $b){}
|
||||
|
||||
public function encode(Vector3 $pos) : array{
|
||||
return [LevelEventPacket::standardParticle(ParticleIds::TERRAIN, TypeConverter::getInstance()->getBlockTranslator()->toRuntimeId($this->b->getStateId()), $pos)];
|
||||
return [LevelEventPacket::standardParticle(ParticleIds::TERRAIN, TypeConverter::getInstance()->getBlockTranslator()->internalIdToNetworkId($this->b->getStateId()), $pos)];
|
||||
}
|
||||
}
|
||||
|
@ -33,6 +33,6 @@ class BlockBreakSound implements Sound{
|
||||
public function __construct(private Block $block){}
|
||||
|
||||
public function encode(Vector3 $pos) : array{
|
||||
return [LevelSoundEventPacket::nonActorSound(LevelSoundEvent::BREAK, $pos, false, TypeConverter::getInstance()->getBlockTranslator()->toRuntimeId($this->block->getStateId()))];
|
||||
return [LevelSoundEventPacket::nonActorSound(LevelSoundEvent::BREAK, $pos, false, TypeConverter::getInstance()->getBlockTranslator()->internalIdToNetworkId($this->block->getStateId()))];
|
||||
}
|
||||
}
|
||||
|
@ -33,6 +33,6 @@ class BlockPlaceSound implements Sound{
|
||||
public function __construct(private Block $block){}
|
||||
|
||||
public function encode(Vector3 $pos) : array{
|
||||
return [LevelSoundEventPacket::nonActorSound(LevelSoundEvent::PLACE, $pos, false, TypeConverter::getInstance()->getBlockTranslator()->toRuntimeId($this->block->getStateId()))];
|
||||
return [LevelSoundEventPacket::nonActorSound(LevelSoundEvent::PLACE, $pos, false, TypeConverter::getInstance()->getBlockTranslator()->internalIdToNetworkId($this->block->getStateId()))];
|
||||
}
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ class BlockPunchSound implements Sound{
|
||||
LevelSoundEvent::HIT,
|
||||
$pos,
|
||||
false,
|
||||
TypeConverter::getInstance()->getBlockTranslator()->toRuntimeId($this->block->getStateId())
|
||||
TypeConverter::getInstance()->getBlockTranslator()->internalIdToNetworkId($this->block->getStateId())
|
||||
)];
|
||||
}
|
||||
}
|
||||
|
@ -43,7 +43,7 @@ class EntityLandSound implements Sound{
|
||||
return [LevelSoundEventPacket::create(
|
||||
LevelSoundEvent::LAND,
|
||||
$pos,
|
||||
TypeConverter::getInstance()->getBlockTranslator()->toRuntimeId($this->blockLandedOn->getStateId()),
|
||||
TypeConverter::getInstance()->getBlockTranslator()->internalIdToNetworkId($this->blockLandedOn->getStateId()),
|
||||
$this->entity::getNetworkTypeId(),
|
||||
false, //TODO: does isBaby have any relevance here?
|
||||
false
|
||||
|
@ -42,7 +42,7 @@ final class ItemUseOnBlockSound implements Sound{
|
||||
LevelSoundEvent::ITEM_USE_ON,
|
||||
$pos,
|
||||
false,
|
||||
TypeConverter::getInstance()->getBlockTranslator()->toRuntimeId($this->block->getStateId())
|
||||
TypeConverter::getInstance()->getBlockTranslator()->internalIdToNetworkId($this->block->getStateId())
|
||||
)];
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user