This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @name ClosureTaskTest | |
* @version 1.0.0 | |
* @main PJZ9n\ClosureTaskTest\ClosureTaskTest | |
* @api 3.12.0 | |
*/ | |
declare(strict_types=1); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//動かない例 | |
[ | |
"content" => [ | |
"type" => "input", | |
"text" => "入力してください", | |
], | |
]; | |
//動く例 | |
[ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
declare(strict_types=1); | |
use pocketmine\Server; | |
use pocketmine\Player; | |
//オンラインのプレイヤーを全員取得 | |
//[object Player, object Player, object Player] | |
$onlinePlayers = Server::getInstance()->getOnlinePlayers(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @name SSTest | |
* @version 1.0.0 | |
* @main PJZ9n\SSTest\SSTest | |
* @api 3.12.0 | |
*/ | |
declare(strict_types=1); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function onDataPacketReceive(DataPacketReceiveEvent $event): void | |
{ | |
$receivePacket = $event->getPacket(); | |
if ($receivePacket instanceof ServerSettingsRequestPacket) { | |
$responsePacket = new ServerSettingsResponsePacket(); | |
$responsePacket->formId = 12345;//Form ID | |
//適当なCustomFormデータ | |
$responsePacket->formData = json_encode([ | |
"type" => "custom_form", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//脆弱なコード(一部省略) | |
$data = [ | |
"buttons" => [ | |
[ | |
"text" => "クリエイティブになる", | |
], | |
[ | |
"text" => "サバイバルになる", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function onDataPacketReceive(DataPacketReceiveEvent $event) | |
{ | |
$packet = $event->getPacket(); | |
if ($packet instanceof PlayerActionPacket) { | |
$name = $event->getPlayer()->getName(); | |
switch ($packet->action) { | |
case PlayerActionPacket::ACTION_START_BREAK://破壊開始 | |
$this->isBreaking[$name] = true; | |
break; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Copyright (c) 2020 PJZ9n. | |
* | |
* This file is part of Tuihai. | |
* | |
* Tuihai is free software: you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License as published by | |
* the Free Software Foundation, either version 3 of the License, or |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Copyright (c) 2020 PJZ9n. | |
* | |
* This file is part of Tuihai. | |
* | |
* Tuihai is free software: you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License as published by | |
* the Free Software Foundation, either version 3 of the License, or |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Copyright (c) 2020 PJZ9n. | |
* | |
* This file is part of Hello-TwitterAPI. | |
* | |
* Hello-TwitterAPI is free software: you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License as published by | |
* the Free Software Foundation, either version 3 of the License, or |