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); | |
echo "-- PocketMineSourceInstaller --" . PHP_EOL; | |
echo "comment out" . PHP_EOL; | |
//フォルダ入力 | |
folder: | |
echo "folder: "; |
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); | |
echo "-- PocketMineSourceInstaller --" . PHP_EOL; | |
echo "install" . PHP_EOL; | |
//バージョン入力 | |
version: | |
echo "version: "; |
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 onPlayerJoin(PlayerJoinEvent $event): void | |
{ | |
$player = $event->getPlayer(); | |
$level = $this->getServer()->getDefaultLevel(); | |
$chunkZ = 0; | |
$createCount = 0; | |
$failedCount = 0; | |
$this->getScheduler()->scheduleDelayedRepeatingTask(new ClosureTask(function (int $currentTick) use ($level, $player, &$chunkZ, &$createCount, &$failedCount) : void { | |
for ($i = 0; $i < 10; $i++) { |
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 | |
mb_substr($this->currentDirectory, -1, 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 | |
/** | |
* @param int $id | |
* | |
* @throws InvalidArgumentException | |
*/ | |
public static function validateItemId(int $id): void | |
{ | |
if ($id < -0x8000 or $id > 0x7fff) { //signed short range |
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 | |
/** | |
* @param int $type | |
* @param int $itemId | |
* @param int $itemDamage | |
* | |
* @return ShopItem|null | |
*/ | |
public function searchShopItem(int $type, int $itemId, int $itemDamage): ?ShopItem | |
{ |
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 NewChestShop. | |
* | |
* NewChestShop 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 NewChestShop. | |
* | |
* NewChestShop 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 | |
public function onPlayerChestInventoryChange(PlayerChestInventoryChangeEvent $event): void | |
{ | |
$source = $event->getSource(); | |
$target = $event->getTarget(); | |
$player = $event->getPlayerCursorInventory()->getHolder(); | |
//$player->removeWindow($event->getChestInventory()); | |
/*$form = new class implements Form { | |
public function handleResponse(Player $player, $data): void | |
{ |
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 pjz9n\joinmessage; | |
use pocketmine\event\Listener; | |
use pocketmine\event\player\PlayerJoinEvent; | |
use pocketmine\plugin\PluginBase; | |
use pocketmine\utils\Config; |