Changed face position floating-point params to Vector3s

This commit is contained in:
Dylan K. Taylor
2017-08-20 10:23:34 +01:00
parent 5b3bed8b06
commit e1d894057c
50 changed files with 96 additions and 75 deletions

View File

@ -2364,6 +2364,7 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
}
$blockVector = new Vector3($packet->x, $packet->y, $packet->z);
$facePos = new Vector3($packet->fx, $packet->fy, $packet->fz);
$this->craftingType = 0;
@ -2373,7 +2374,7 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
if(!$this->canInteract($blockVector->add(0.5, 0.5, 0.5), 13) or $this->isSpectator()){
}elseif($this->isCreative()){
$item = $this->inventory->getItemInHand();
if($this->level->useItemOn($blockVector, $item, $packet->face, $packet->fx, $packet->fy, $packet->fz, $this, true) === true){
if($this->level->useItemOn($blockVector, $item, $packet->face, $facePos, $this, true) === true){
return true;
}
}elseif(!$this->inventory->getItemInHand()->equals($packet->item)){
@ -2381,7 +2382,7 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
}else{
$item = $this->inventory->getItemInHand();
$oldItem = clone $item;
if($this->level->useItemOn($blockVector, $item, $packet->face, $packet->fx, $packet->fy, $packet->fz, $this, true)){
if($this->level->useItemOn($blockVector, $item, $packet->face, $facePos, $this, true)){
if(!$item->equals($oldItem) or $item->getCount() !== $oldItem->getCount()){
$this->inventory->setItemInHand($item);
$this->inventory->sendHeldItem($this->hasSpawned);