mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
Adventure Mode
This commit is contained in:
parent
eaa3006d51
commit
d24d826ffd
5 changed files with 32 additions and 14 deletions
|
|
@ -136,7 +136,7 @@ class Entity extends stdClass{
|
|||
$this->close(); //Despawn timer
|
||||
return false;
|
||||
}
|
||||
if($this->server->gamemode === 0 and ($time - $this->spawntime) >= 2){
|
||||
if(($this->server->gamemode === 0 or $this->server->gamemode === 2) and ($time - $this->spawntime) >= 2){
|
||||
$player = $this->server->query("SELECT EID FROM entities WHERE class == ".ENTITY_PLAYER." AND abs(x - {$this->x}) <= 1.5 AND abs(y - {$this->y}) <= 1.5 AND abs(z - {$this->z}) <= 1.5 LIMIT 1;", true);
|
||||
if($player !== true and $player !== false){
|
||||
if($this->server->api->dhandle("player.pickup", array(
|
||||
|
|
@ -486,7 +486,7 @@ class Entity extends stdClass{
|
|||
if($health < $this->health){
|
||||
$harm = true;
|
||||
$dmg = $this->health - $health;
|
||||
if(($this->server->gamemode === 0 or $force === true) and ($this->dmgcounter[0] < microtime(true) or $this->dmgcounter[1] < $dmg) and !$this->dead){
|
||||
if(($this->server->gamemode === 0 or $this->server->gamemode === 2 or $force === true or $this->class !== ENTITY_PLAYER) and ($this->dmgcounter[0] < microtime(true) or $this->dmgcounter[1] < $dmg) and !$this->dead){
|
||||
$this->dmgcounter[0] = microtime(true) + 0.5;
|
||||
$this->dmgcounter[1] = $dmg;
|
||||
}else{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue