mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 19:49:44 +00:00
onUpdate is now static, disabled rail, water and lava updates to rework.
This commit is contained in:
parent
3c37dc446e
commit
ee989ef556
38 changed files with 329 additions and 367 deletions
|
|
@ -527,17 +527,11 @@ class BlockAPI{
|
|||
}
|
||||
|
||||
public function blockUpdate(Position $pos, $type = BLOCK_UPDATE_NORMAL){
|
||||
if(!($pos instanceof Block)){
|
||||
$block = $pos->level->getBlock($pos);
|
||||
}else{
|
||||
$pos = new Position($pos->x, $pos->y, $pos->z, $pos->level);
|
||||
$block = $pos->level->getBlock($pos);
|
||||
}
|
||||
$block = StaticBlock::getBlock($pos->level->level->getBlockID($pos->x, $pos->y, $pos->z));
|
||||
if($block === false){
|
||||
return false;
|
||||
}
|
||||
|
||||
$level = $block->onUpdate($type);
|
||||
$level = $block::onUpdate($pos->level, $pos->x, $pos->y, $pos->z, $type);
|
||||
if($level === BLOCK_UPDATE_NORMAL){
|
||||
$this->blockUpdateAround($block, $level);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,13 @@ class TileAPI{
|
|||
$this->tiles = [];
|
||||
$this->server = ServerAPI::request();
|
||||
}
|
||||
|
||||
public function getXYZ(Level $level, $x, $y, $z){
|
||||
$tile = $this->server->query("SELECT * FROM tiles WHERE level = '{$level->getName()}' AND x = $z AND y = $y AND z = $z;", true);
|
||||
if($tile !== false and $tile !== true and ($tile = $this->getByID($tile["ID"])) !== false){
|
||||
return $tile;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public function get(Position $pos){
|
||||
$tile = $this->server->query("SELECT * FROM tiles WHERE level = '" . $pos->level->getName() . "' AND x = {$pos->x} AND y = {$pos->y} AND z = {$pos->z};", true);
|
||||
if($tile !== false and $tile !== true and ($tile = $this->getByID($tile["ID"])) !== false){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue