mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-23 04:59:46 +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;
|
break;
|
||||||
case "player.block.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.
|
case "player.block.place"://Spawn protection detection. Allows OPs to place/break blocks in the spawn area.
|
||||||
if(!$this->isOp($data["player"]->iusername)){
|
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);
|
$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){
|
if($t->distance($s) <= $this->server->api->getProperty("spawn-protection") and $this->server->api->dhandle($event . ".spawn", $data) !== true){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
break;
|
|
||||||
case "console.command"://Checks if a command is allowed with the current user permissions.
|
case "console.command"://Checks if a command is allowed with the current user permissions.
|
||||||
if(isset($this->cmdWhitelist[$data["cmd"]])){
|
if(isset($this->cmdWhitelist[$data["cmd"]])){
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue