mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
Place/Breaking/Activation logic separated from BlockAPI
This commit is contained in:
parent
6156baab85
commit
d9c87161ba
37 changed files with 387 additions and 216 deletions
|
|
@ -29,11 +29,19 @@ the Free Software Foundation, either version 3 of the License, or
|
|||
class GenericBlock extends Block{
|
||||
public function __construct($id, $meta = 0, $name = "Unknown"){
|
||||
parent::__construct($id, $meta, $name);
|
||||
}
|
||||
public function onUpdate(LevelAPI $level, $type){
|
||||
}
|
||||
public function place(BlockAPI $level, Item $item, Player $player, Block $block, Block $target, $face){
|
||||
if($block->inWorld === true){
|
||||
$level->setBlock($block, $this->id, $this->getMetadata());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public function onActivate(LevelAPI $level, Item $item, Player $player){
|
||||
|
||||
public function onUpdate(BlockAPI $level, $type){
|
||||
return false;
|
||||
}
|
||||
public function onActivate(BlockAPI $level, Item $item, Player $player){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue