mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
PMF & Multiworld [part 1]
This commit is contained in:
parent
bbbc54f606
commit
db8f50f408
18 changed files with 626 additions and 548 deletions
|
|
@ -30,31 +30,23 @@ class GenericBlock extends Block{
|
|||
public function __construct($id, $meta = 0, $name = "Unknown"){
|
||||
parent::__construct($id, $meta, $name);
|
||||
}
|
||||
public function place(BlockAPI $level, Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
|
||||
if($block->inWorld === true){
|
||||
$level->setBlock($block, $this->id, $this->getMetadata());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
|
||||
return $this->level->setBlock($block, $this);
|
||||
}
|
||||
|
||||
public function isBreakable(Item $item, Player $player){
|
||||
return ($this->breakable);
|
||||
}
|
||||
|
||||
public function onBreak(BlockAPI $level, Item $item, Player $player){
|
||||
if($this->inWorld === true){
|
||||
$level->setBlock($this, AIR, 0);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
public function onBreak(Item $item, Player $player){
|
||||
return $this->level->setBlock($this, BlockAPI::getBlock(AIR, 0));
|
||||
}
|
||||
|
||||
public function onUpdate(BlockAPI $level, $type){
|
||||
public function onUpdate($type){
|
||||
return false;
|
||||
}
|
||||
|
||||
public function onActivate(BlockAPI $level, Item $item, Player $player){
|
||||
public function onActivate(Item $item, Player $player){
|
||||
return ($this->isActivable);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue