mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-23 21:19:44 +00:00
bug 107 fix
This commit is contained in:
parent
51442ed771
commit
a4c1f1e995
2 changed files with 8 additions and 2 deletions
|
|
@ -63,7 +63,11 @@ class BanAPI{
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "player.block.break":
|
case "player.block.break":
|
||||||
if(!$this->isOp($data["player"]->iusername)){
|
/**
|
||||||
|
* @var Player $player
|
||||||
|
*/
|
||||||
|
$player = $data["player"];
|
||||||
|
if(!$this->isOp($player->iusername) && $player->level->getName() === $this->server->api->level->getDefault()){
|
||||||
$t = new Vector2($data["target"]->x, $data["target"]->z);
|
$t = new Vector2($data["target"]->x, $data["target"]->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){
|
||||||
|
|
@ -72,7 +76,8 @@ class BanAPI{
|
||||||
}
|
}
|
||||||
return;
|
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)){
|
$player = $data["player"];
|
||||||
|
if(!$this->isOp($player->iusername) && $player->level->getName() === $this->server->api->level->getDefault()){
|
||||||
$t = new Vector2($data["block"]->x, $data["block"]->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){
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ class Level{
|
||||||
$this->server = ServerAPI::request();
|
$this->server = ServerAPI::request();
|
||||||
$this->level = $level;
|
$this->level = $level;
|
||||||
$this->level->level = $this;
|
$this->level->level = $this;
|
||||||
|
$this->entityList = [];
|
||||||
$this->entities = $entities;
|
$this->entities = $entities;
|
||||||
$this->tiles = $tiles;
|
$this->tiles = $tiles;
|
||||||
$this->blockUpdates = $blockUpdates;
|
$this->blockUpdates = $blockUpdates;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue