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
int stringToKeycode(String s) throws Exception { | |
switch (s) { | |
case "A": | |
return KeyEvent.VK_A; | |
case "B": | |
return KeyEvent.VK_B; | |
case "C": | |
return KeyEvent.VK_C; | |
case "D": | |
return KeyEvent.VK_D; |
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 | |
if (!$sender instanceof Player) { | |
return true; | |
} | |
$basePos = $sender->asVector3(); | |
$basePos = $basePos->add(0, 1, 0);//高さ上げ | |
switch ($sender->getDirection()) { | |
case 3: | |
$pos = $basePos->add(1, 0, 0); | |
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 | |
declare(strict_types=1); | |
use pocketmine\level\Level; | |
use pocketmine\level\particle\FloatingTextParticle; | |
use pocketmine\math\Vector3; | |
use pocketmine\plugin\Plugin; | |
use pocketmine\scheduler\ClosureTask; |
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); | |
namespace Author\PluginName; | |
use pocketmine\command\Command; | |
use pocketmine\command\CommandSender; | |
use pocketmine\form\Form; | |
use pocketmine\Player; |
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); | |
/** @var \pocketmine\item\Item $item */ | |
$namedtag = $item->getNamedTag(); | |
//セットするタグ | |
$setTag = new \pocketmine\nbt\tag\CompoundTag("プラグイン名", [ |
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); | |
/** @var \pocketmine\Server $server */ | |
$players = implode(", ", array_map(function (\pocketmine\Player $player): string { | |
/** @var \pocketmine\Player $player */ | |
return $player->getName(); | |
}, $server->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 | |
declare(strict_types=1); | |
/** @var \pocketmine\Server $server */ | |
$players = $server->getOnlinePlayers(); | |
$options = array_map(function ($player) { | |
/** @var \pocketmine\Player $player */ | |
return $player->getName(); | |
}, $players); |
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
Header set Content-Disposition attachment | |
RemoveType .phar | |
RemoveHandler .phar | |
<FilesMatch \.phar$> | |
SetHandler text/plain | |
</FilesMatch> |
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); | |
//https://www.php.net/manual/ja/language.operators.logical.php | |
//if文は、()に入れられた値がtrueだったら処理を実行する | |
if (true) { | |
//処理が実行される |
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); | |
namespace foo\bar; | |
use pocketmine\form\Form; | |
use pocketmine\Player; | |
class ExampleForm implements Form |