Block->place() parameter refactor to make things clearer

This commit is contained in:
Dylan K. Taylor
2017-08-26 14:41:49 +01:00
parent 20f34fba53
commit 6d5620606e
44 changed files with 122 additions and 122 deletions

View File

@ -60,13 +60,13 @@ class SignPost extends Transparent{
}
public function place(Item $item, Block $block, Block $target, int $face, Vector3 $facePos, Player $player = null) : bool{
public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $facePos, Player $player = null) : bool{
if($face !== Vector3::SIDE_DOWN){
$nbt = new CompoundTag("", [
new StringTag("id", Tile::SIGN),
new IntTag("x", $block->x),
new IntTag("y", $block->y),
new IntTag("z", $block->z),
new IntTag("x", $blockReplace->x),
new IntTag("y", $blockReplace->y),
new IntTag("z", $blockReplace->z),
new StringTag("Text1", ""),
new StringTag("Text2", ""),
new StringTag("Text3", ""),
@ -85,10 +85,10 @@ class SignPost extends Transparent{
if($face === Vector3::SIDE_UP){
$this->meta = floor((($player->yaw + 180) * 16 / 360) + 0.5) & 0x0f;
$this->getLevel()->setBlock($block, $this, true);
$this->getLevel()->setBlock($blockReplace, $this, true);
}else{
$this->meta = $face;
$this->getLevel()->setBlock($block, new WallSign($this->meta), true);
$this->getLevel()->setBlock($blockReplace, new WallSign($this->meta), true);
}
Tile::createTile(Tile::SIGN, $this->getLevel(), $nbt);