mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 20:19:44 +00:00
Fixes
This commit is contained in:
parent
c27cca6741
commit
24c0e2742a
8 changed files with 16 additions and 30 deletions
|
|
@ -34,7 +34,6 @@ class AirBlock extends TransparentBlock{
|
|||
$this->isTransparent = true;
|
||||
$this->isReplaceable = true;
|
||||
$this->isPlaceable = false;
|
||||
$this->inWorld = false;
|
||||
$this->hasPhysics = false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -41,8 +41,8 @@ class BedBlock extends TransparentBlock{
|
|||
3 => 5,
|
||||
);
|
||||
$d = $player->entity->getDirection();
|
||||
$next = $this->level->getBlockFace($block, $faces[(($d + 3) % 4)]);
|
||||
$downNext = $this->level->getBlockFace($next, 0);
|
||||
$next = $this->getSide($faces[(($d + 3) % 4)]);
|
||||
$downNext = $this->getSide(0);
|
||||
if($next->isReplaceable === true and $downNext->isTransparent === false){
|
||||
$meta = (($d + 3) % 4) & 0x03;
|
||||
$this->level->setBlock($block, BlockAPI::get($this->id, $meta));
|
||||
|
|
|
|||
|
|
@ -45,13 +45,11 @@ class SaplingBlock extends TransparentBlock{
|
|||
|
||||
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
|
||||
console("SAPLING SAPLING SAPLING");return false; //Placeholder
|
||||
if($block->inWorld === true){
|
||||
$down = $level->getBlockFace($block, 0);
|
||||
$down = $this->getSide(0);
|
||||
if($down->getID() === GRASS or $down->getID() === DIRT or $down->getID() === FARMLAND){
|
||||
$level->setBlock($block, $this->id, $this->getMetadata());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -66,9 +64,6 @@ class SaplingBlock extends TransparentBlock{
|
|||
|
||||
public function onUpdate($type){
|
||||
console("SAPLING SAPLING SAPLING");return false; //Placeholder
|
||||
if($this->inWorld !== true){
|
||||
return false;
|
||||
}
|
||||
if($type === BLOCK_UPDATE_RANDOM and mt_rand(0,2) === 0){ //Growth
|
||||
if(($this->meta & 0x08) === 0x08){
|
||||
TreeObject::growTree($level, $this);
|
||||
|
|
|
|||
|
|
@ -33,7 +33,6 @@ class BurningFurnaceBlock extends SolidBlock{
|
|||
}
|
||||
|
||||
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
|
||||
if($block->inWorld === true){
|
||||
$faces = array(
|
||||
0 => 4,
|
||||
1 => 2,
|
||||
|
|
@ -43,8 +42,6 @@ class BurningFurnaceBlock extends SolidBlock{
|
|||
$this->meta = $faces[$player->entity->getDirection()];
|
||||
$this->level->setBlock($block, $this);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function onBreak(Item $item, Player $player){
|
||||
|
|
|
|||
|
|
@ -31,18 +31,15 @@ class FenceGateBlock extends TransparentBlock{
|
|||
$this->isActivable = true;
|
||||
}
|
||||
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
|
||||
if($block->inWorld === true){
|
||||
$faces = array(
|
||||
0 => 3,
|
||||
1 => 0,
|
||||
2 => 1,
|
||||
3 => 2,
|
||||
);
|
||||
$this->meta = $faces[$player->entity->getDirection()] & 0x03;
|
||||
$this->level->setBlock($block, $this);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
$faces = array(
|
||||
0 => 3,
|
||||
1 => 0,
|
||||
2 => 1,
|
||||
3 => 2,
|
||||
);
|
||||
$this->meta = $faces[$player->entity->getDirection()] & 0x03;
|
||||
$this->level->setBlock($block, $this);
|
||||
return true;
|
||||
}
|
||||
public function getDrops(Item $item, Player $player){
|
||||
return array(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue