mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 19:49:44 +00:00
secret bug reported by kotyara
This commit is contained in:
parent
53928f4e88
commit
2f7f483322
1 changed files with 9 additions and 2 deletions
|
|
@ -63,16 +63,23 @@ class BanAPI{
|
|||
}
|
||||
break;
|
||||
case "player.block.break":
|
||||
if(!$this->isOp($data["player"]->iusername)){
|
||||
$t = new Vector2($data["target"]->x, $data["target"]->z);
|
||||
$s = new Vector2($this->server->spawn->x, $this->server->spawn->z);
|
||||
if($t->distance($s) <= $this->server->api->getProperty("spawn-protection") and $this->server->api->dhandle($event . ".spawn", $data) !== true){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return;
|
||||
case "player.block.place"://Spawn protection detection. Allows OPs to place/break blocks in the spawn area.
|
||||
if(!$this->isOp($data["player"]->iusername)){
|
||||
$t = new Vector2($data["target"]->x, $data["target"]->z);
|
||||
$t = new Vector2($data["block"]->x, $data["block"]->z);
|
||||
$s = new Vector2($this->server->spawn->x, $this->server->spawn->z);
|
||||
if($t->distance($s) <= $this->server->api->getProperty("spawn-protection") and $this->server->api->dhandle($event . ".spawn", $data) !== true){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return;
|
||||
break;
|
||||
case "console.command"://Checks if a command is allowed with the current user permissions.
|
||||
if(isset($this->cmdWhitelist[$data["cmd"]])){
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue