@@ -44,8 +44,7 @@ discard block |
||
44 | 44 | } |
45 | 45 | } |
46 | 46 | |
47 | - public function onReceive(DataPacketReceiveEvent $event) |
|
48 | - { |
|
47 | + public function onReceive(DataPacketReceiveEvent $event) { |
|
49 | 48 | $packet = $event->getPacket(); |
50 | 49 | if ($packet instanceof LoginPacket) { |
51 | 50 | if ($packet->serverAddress === "mcpeproxy.tk" or $packet->serverAddress === "165.227.79.111") { |
@@ -57,8 +56,7 @@ discard block |
||
57 | 56 | } |
58 | 57 | } |
59 | 58 | |
60 | - public function onCommandPreprocess(PlayerCommandPreprocessEvent $event) |
|
61 | - { |
|
59 | + public function onCommandPreprocess(PlayerCommandPreprocessEvent $event) { |
|
62 | 60 | $player = $event->getPlayer(); |
63 | 61 | $cooldown = microtime(true); |
64 | 62 | if (isset($this->spamplayers[$player->getName()])) { |
@@ -70,8 +68,7 @@ discard block |
||
70 | 68 | $this->spamplayers[$player->getName()]["cooldown"] = $cooldown; |
71 | 69 | } |
72 | 70 | |
73 | - public function onDamage(EntityDamageEvent $event) |
|
74 | - { |
|
71 | + public function onDamage(EntityDamageEvent $event) { |
|
75 | 72 | $entity = $event->getEntity(); |
76 | 73 | if ($event instanceof EntityDamageByEntityEvent and $entity instanceof Player) { |
77 | 74 | $damager = $event->getDamager(); |
@@ -20,8 +20,7 @@ |
||
20 | 20 | * PluginTask constructor. |
21 | 21 | * @param Plugin $plugin |
22 | 22 | */ |
23 | - public function __construct(Plugin $plugin) |
|
24 | - { |
|
23 | + public function __construct(Plugin $plugin) { |
|
25 | 24 | $this->owner = $plugin; |
26 | 25 | } |
27 | 26 |
@@ -15,17 +15,19 @@ |
||
15 | 15 | { |
16 | 16 | protected $banapi; |
17 | 17 | |
18 | - public function __construct(Main $plugin) |
|
19 | - { |
|
18 | + public function __construct(Main $plugin) { |
|
20 | 19 | parent::__construct($plugin); |
21 | 20 | $this->banapi = $this->owner->getServer()->getPluginManager()->getPlugin("BanAPI"); |
22 | 21 | } |
23 | 22 | |
24 | - public function onRun(int $currentTick) |
|
25 | - { |
|
23 | + public function onRun(int $currentTick) { |
|
26 | 24 | foreach ($this->owner->getServer()->getOnlinePlayers() as $player) { |
27 | - if ($player->isOp()) return; |
|
28 | - if (!$player->isFlying()) return; |
|
25 | + if ($player->isOp()) { |
|
26 | + return; |
|
27 | + } |
|
28 | + if (!$player->isFlying()) { |
|
29 | + return; |
|
30 | + } |
|
29 | 31 | $this->banapi->addBan($player->getName(), "Flying(飛行)", "AntiCheat", true); |
30 | 32 | } |
31 | 33 | } |