Replaced some bad usages of Vector3 get*() with their respective getFloor*()

This commit is contained in:
Dylan K. Taylor 2018-02-14 18:45:10 +00:00
parent 0b82d5c8d4
commit a84aba5517
5 changed files with 10 additions and 10 deletions

View File

@ -390,9 +390,9 @@ class BlockFactory{
}
if($pos !== null){
$block->x = $pos->x;
$block->y = $pos->y;
$block->z = $pos->z;
$block->x = $pos->getFloorX();
$block->y = $pos->getFloorY();
$block->z = $pos->getFloorZ();
$block->level = $pos->level;
}

View File

@ -89,6 +89,6 @@ class ChestInventory extends ContainerInventory{
$pk->z = (int) $holder->z;
$pk->eventType = 1; //it's always 1 for a chest
$pk->eventData = $isOpen ? 1 : 0;
$holder->getLevel()->addChunkPacket($holder->getX() >> 4, $holder->getZ() >> 4, $pk);
$holder->getLevel()->addChunkPacket($holder->getFloorX() >> 4, $holder->getFloorZ() >> 4, $pk);
}
}

View File

@ -51,9 +51,9 @@ abstract class ContainerInventory extends BaseInventory{
if($holder instanceof Entity){
$pk->entityUniqueId = $holder->getId();
}elseif($holder instanceof Vector3){
$pk->x = (int) $holder->getX();
$pk->y = (int) $holder->getY();
$pk->z = (int) $holder->getZ();
$pk->x = $holder->getFloorX();
$pk->y = $holder->getFloorY();
$pk->z = $holder->getFloorZ();
}
$who->dataPacket($pk);

View File

@ -55,7 +55,7 @@ class EnderChestInventory extends ChestInventory{
* @param EnderChest $enderChest
*/
public function setHolderPosition(EnderChest $enderChest){
$this->holder->setComponents($enderChest->getX(), $enderChest->getY(), $enderChest->getZ());
$this->holder->setComponents($enderChest->getFloorX(), $enderChest->getFloorY(), $enderChest->getFloorZ());
$this->holder->setLevel($enderChest->getLevel());
}

View File

@ -2666,7 +2666,7 @@ class Level implements ChunkManager, Metadatable{
throw new LevelException("Invalid Tile level");
}
$this->tiles[$tile->getId()] = $tile;
$this->clearChunkCache($tile->getX() >> 4, $tile->getZ() >> 4);
$this->clearChunkCache($tile->getFloorX() >> 4, $tile->getFloorZ() >> 4);
}
/**
@ -2681,7 +2681,7 @@ class Level implements ChunkManager, Metadatable{
unset($this->tiles[$tile->getId()]);
unset($this->updateTiles[$tile->getId()]);
$this->clearChunkCache($tile->getX() >> 4, $tile->getZ() >> 4);
$this->clearChunkCache($tile->getFloorX() >> 4, $tile->getFloorZ() >> 4);
}
/**