mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 19:49:44 +00:00
New Entity update system, scheduled updates when needed only
This commit is contained in:
parent
3ac4b0af68
commit
66e635daeb
8 changed files with 91 additions and 50 deletions
|
|
@ -29,7 +29,6 @@ class DoorBlock extends TransparentBlock{
|
|||
public function __construct($id, $meta = 0, $name = "Unknown"){
|
||||
parent::__construct($id, $meta, $name);
|
||||
$this->isSolid = false;
|
||||
$this->isFullBlock = false;
|
||||
}
|
||||
|
||||
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
|
||||
|
|
|
|||
|
|
@ -40,9 +40,9 @@ class FallableBlock extends SolidBlock{
|
|||
"Tile" => $this->id,
|
||||
);
|
||||
$server = ServerAPI::request();
|
||||
$this->level->setBlock($this, new AirBlock());
|
||||
$e = $server->api->entity->add($this->level, ENTITY_FALLING, FALLING_SAND, $data);
|
||||
$server->api->entity->spawnToAll($this->level, $e->eid);
|
||||
$this->level->setBlock($this, new AirBlock());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -28,7 +28,11 @@ the Free Software Foundation, either version 3 of the License, or
|
|||
class StairBlock extends TransparentBlock{
|
||||
public function __construct($id, $meta = 0, $name = "Unknown"){
|
||||
parent::__construct($id, $meta, $name);
|
||||
$this->isFullBlock = false;
|
||||
if(($this->meta & 0x04) === 0x04){
|
||||
$this->isFullBlock = true;
|
||||
}else{
|
||||
$this->isFullBlock = false;
|
||||
}
|
||||
}
|
||||
|
||||
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
|
||||
|
|
|
|||
|
|
@ -29,7 +29,11 @@ class TrapdoorBlock extends TransparentBlock{
|
|||
public function __construct($meta = 0){
|
||||
parent::__construct(TRAPDOOR, $meta, "Trapdoor");
|
||||
$this->isActivable = true;
|
||||
$this->isFullBlock = false;
|
||||
if(($this->meta & 0x04) === 0x04){
|
||||
$this->isFullBlock = false;
|
||||
}else{
|
||||
$this->isFullBlock = true;
|
||||
}
|
||||
}
|
||||
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
|
||||
if(($target->isTransparent === false or $target->getID() === SLAB) and $face !== 0 and $face !== 1){
|
||||
|
|
|
|||
|
|
@ -29,7 +29,11 @@ class FenceGateBlock extends TransparentBlock{
|
|||
public function __construct($meta = 0){
|
||||
parent::__construct(FENCE_GATE, $meta, "Fence Gate");
|
||||
$this->isActivable = true;
|
||||
$this->isFullBlock = false;
|
||||
if(($this->meta & 0x04) === 0x04){
|
||||
$this->isFullBlock = true;
|
||||
}else{
|
||||
$this->isFullBlock = false;
|
||||
}
|
||||
}
|
||||
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
|
||||
$faces = array(
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@ the Free Software Foundation, either version 3 of the License, or
|
|||
class GlassPaneBlock extends TransparentBlock{
|
||||
public function __construct(){
|
||||
parent::__construct(GLASS_PANE, 0, "Glass Pane");
|
||||
$this->isFullBlock = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -39,7 +39,11 @@ class SlabBlock extends TransparentBlock{
|
|||
7 => "Quartz",
|
||||
);
|
||||
$this->name = (($this->meta & 0x08) === 0x08 ? "Upper ":"") . $names[$this->meta & 0x07] . " Slab";
|
||||
$this->isFullBlock = false;
|
||||
if(($this->meta & 0x08) === 0x08){
|
||||
$this->isFullBlock = true;
|
||||
}else{
|
||||
$this->isFullBlock = false;
|
||||
}
|
||||
}
|
||||
|
||||
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue