mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-23 13:09:44 +00:00
particial fix of bug 13, names fixed
This commit is contained in:
parent
0f6784c4f3
commit
af36fb318a
1 changed files with 14 additions and 13 deletions
|
|
@ -1,14 +1,15 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
class Leaves2Block extends TransparentBlock{
|
class Leaves2Block extends TransparentBlock{
|
||||||
public function __construct($meta = 0){
|
|
||||||
parent::__construct(LEAVES2, $meta, "Leaves2");
|
protected static $names = [
|
||||||
$names = array(
|
0 => "Acacia Leaves",
|
||||||
0 => "Acacia Leaves",
|
1 => "Dark Oak Leaves"
|
||||||
1 => "Dark Oak Leaves",
|
];
|
||||||
);
|
|
||||||
$this->name = $names[$this->meta & 0x02];
|
public function __construct($meta = 0){
|
||||||
$this->hardness = 1;
|
parent::__construct(LEAVES2, $meta, nullsafe(self::$names[$meta & 0x03], "Leaves"));
|
||||||
|
$this->hardness = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function createIndex($x, $y, $z){
|
private function createIndex($x, $y, $z){
|
||||||
|
|
@ -37,7 +38,7 @@ class Leaves2Block extends TransparentBlock{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function onUpdate($type){
|
public function onUpdate($type){
|
||||||
if($type === BLOCK_UPDATE_NORMAL){
|
if($type === BLOCK_UPDATE_NORMAL){
|
||||||
if(($this->meta & 0b00001100) === 0){
|
if(($this->meta & 0b00001100) === 0){
|
||||||
$this->meta |= 0x08;
|
$this->meta |= 0x08;
|
||||||
|
|
@ -64,7 +65,7 @@ class Leaves2Block extends TransparentBlock{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
|
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
|
||||||
$this->meta |= 0x04;
|
$this->meta |= 0x04;
|
||||||
$this->level->setBlock($this, $this, true, false, true);
|
$this->level->setBlock($this, $this, true, false, true);
|
||||||
}
|
}
|
||||||
|
|
@ -72,7 +73,7 @@ class Leaves2Block extends TransparentBlock{
|
||||||
public function getDrops(Item $item, Player $player){
|
public function getDrops(Item $item, Player $player){
|
||||||
$drops = array();
|
$drops = array();
|
||||||
if($item->isShears()){
|
if($item->isShears()){
|
||||||
$drops[] = array(LEAVES2, $this->meta & 0x03, 1);
|
$drops[] = array(LEAVES2, $this->getMetadata(), 1);
|
||||||
}else{
|
}else{
|
||||||
if(mt_rand(1, 20) === 1){ //Saplings
|
if(mt_rand(1, 20) === 1){ //Saplings
|
||||||
$drops[] = array(SAPLING, $this->meta + 2 & 0x05, 1);
|
$drops[] = array(SAPLING, $this->meta + 2 & 0x05, 1);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue