BlockTranslator: use less ambiguous function names

This commit is contained in:
Dylan K. Taylor
2023-05-05 14:47:23 +01:00
parent 4f32f5e0b7
commit 289ede669d
15 changed files with 19 additions and 19 deletions

View File

@ -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)];
}
}

View File

@ -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)];
}
}

View File

@ -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(

View File

@ -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)];
}
}