mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 19:49:44 +00:00
34 lines
No EOL
740 B
PHP
34 lines
No EOL
740 B
PHP
<?php
|
|
|
|
class Log2Block extends SolidBlock{
|
|
public function __construct($meta = 0){
|
|
parent::__construct(LOG2, $meta, "Log2");
|
|
$names = array(
|
|
0 => "Acacia Log",
|
|
1 => "Dark Oak Log",
|
|
);
|
|
$this->name = $names[$this->meta & 0x02];
|
|
$this->hardness = 10;
|
|
}
|
|
|
|
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
|
|
$faces = array(
|
|
0 => 0,
|
|
1 => 0,
|
|
2 => 0b1000,
|
|
3 => 0b1000,
|
|
4 => 0b0100,
|
|
5 => 0b0100,
|
|
);
|
|
|
|
$this->meta = ($this->meta & 0x03) | $faces[$face];
|
|
$this->level->setBlock($block, $this, true, false, true);
|
|
return true;
|
|
}
|
|
|
|
public function getDrops(Item $item, Player $player){
|
|
return array(
|
|
array($this->id, $this->meta & 0x02, 1),
|
|
);
|
|
}
|
|
} |