mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 12:09:43 +00:00
bad
This commit is contained in:
parent
aa0031b910
commit
b712c4b7a9
10 changed files with 257 additions and 100 deletions
|
|
@ -20,7 +20,7 @@ class SaplingBlock extends FlowableBlock{
|
|||
4 => "Acacia Sapling",
|
||||
5 => "Dark Oak Sapling",
|
||||
);
|
||||
$this->name = $names[$this->meta & 0x05];
|
||||
$this->name = $names[$this->meta & 0x07];
|
||||
$this->hardness = 0;
|
||||
}
|
||||
|
||||
|
|
@ -36,7 +36,7 @@ class SaplingBlock extends FlowableBlock{
|
|||
|
||||
public function onActivate(Item $item, Player $player){
|
||||
if($item->getID() === DYE and $item->getMetadata() === 0x0F){ //Bonemeal
|
||||
TreeObject::growTree($this->level, $this, new Random(), $this->meta & 0x03);
|
||||
TreeObject::growTree($this->level, $this, new Random(), $this->meta);
|
||||
if(($player->gamemode & 0x01) === 0){
|
||||
$player->removeItem(DYE, 0x0F, 1);
|
||||
}
|
||||
|
|
@ -54,7 +54,7 @@ class SaplingBlock extends FlowableBlock{
|
|||
}elseif($type === BLOCK_UPDATE_RANDOM){ //Growth
|
||||
if(mt_rand(1, 7) === 1){
|
||||
if(($this->meta & 0x08) === 0x08){
|
||||
TreeObject::growTree($this->level, $this, new Random(), $this->meta & 0x03);
|
||||
TreeObject::growTree($this->level, $this, new Random(), $this->meta & 0x07);
|
||||
}else{
|
||||
$this->meta |= 0x08;
|
||||
$this->level->setBlock($this, $this, true, false, true);
|
||||
|
|
@ -69,7 +69,7 @@ class SaplingBlock extends FlowableBlock{
|
|||
|
||||
public function getDrops(Item $item, Player $player){
|
||||
return array(
|
||||
array($this->id, $this->meta & 0x05, 1),
|
||||
array($this->id, $this->meta & 0x07, 1),
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue