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

@ -105,7 +105,7 @@ class ItemFrame extends Flowable{
return false;
}
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 or $face === Vector3::SIDE_UP){
return false;
}
@ -118,13 +118,13 @@ class ItemFrame extends Flowable{
];
$this->meta = $faces[$face];
$this->level->setBlock($block, $this, true, true);
$this->level->setBlock($blockReplace, $this, true, true);
$nbt = new CompoundTag("", [
new StringTag("id", Tile::ITEM_FRAME),
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 FloatTag("ItemDropChance", 1.0),
new ByteTag("ItemRotation", 0)
]);