mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-17 03:08:58 +00:00
Block break optimization
This commit is contained in:
parent
74917923b6
commit
3c0efe9af2
@ -1417,9 +1417,7 @@ class Level implements ChunkManager, Metadatable{
|
|||||||
|
|
||||||
if($player->isSurvival() and $item instanceof Item and !$target->isBreakable($item)){
|
if($player->isSurvival() and $item instanceof Item and !$target->isBreakable($item)){
|
||||||
$ev->setCancelled();
|
$ev->setCancelled();
|
||||||
}
|
}elseif(!$player->isOp() and ($distance = $this->server->getSpawnRadius()) > -1){
|
||||||
|
|
||||||
if(!$player->isOp() and ($distance = $this->server->getSpawnRadius()) > -1){
|
|
||||||
$t = new Vector2($target->x, $target->z);
|
$t = new Vector2($target->x, $target->z);
|
||||||
$s = new Vector2($this->getSpawnLocation()->x, $this->getSpawnLocation()->z);
|
$s = new Vector2($this->getSpawnLocation()->x, $this->getSpawnLocation()->z);
|
||||||
if(count($this->server->getOps()->getAll()) > 0 and $t->distance($s) <= $distance){ //set it to cancelled so plugins can bypass this
|
if(count($this->server->getOps()->getAll()) > 0 and $t->distance($s) <= $distance){ //set it to cancelled so plugins can bypass this
|
||||||
|
Loading…
x
Reference in New Issue
Block a user