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\utils\Binary; // https://github.com/pmmp/BinaryUtils | |
| use pocketmine\utils\Random; // https://github.com/pmmp/PocketMine-MP/blob/60938c8c9df4bf21d096f142c6579dfad92eb8c2/src/utils/Random.php | |
| /** | |
| * @phpstan-template T | |
| */ |
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 | |
| use pocketmine\block\Block; | |
| use pocketmine\event\player\PlayerInteractEvent; | |
| use pocketmine\item\Item; | |
| use pocketmine\math\Facing; | |
| use pocketmine\utils\Random; | |
| public function onPlayerInteract(PlayerInteractEvent $event) : void{ | |
| if($action === PlayerInteractEvent::RIGHT_CLICK_BLOCK && $item->getId() === Item::STICK){ |
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 | |
| const ITERATIONS = 100000; | |
| benchmark(SORT_REGULAR, "SORT_REGULAR"); | |
| benchmark(SORT_NUMERIC, "SORT_NUMERIC"); | |
| function benchmark(int $sort_type, string $sort_type_string){ | |
| $array = []; | |
| for($i = 0; $i < ITERATIONS; ++$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 | |
| use pocketmine\block\Block; | |
| use pocketmine\scheduler\Task; | |
| use pocketmine\tile\Chest; | |
| use pocketmine\tile\Tile; | |
| public function onCommand(CommandSender $issuer, Command $cmd, string $label, array $args) : bool{ | |
| if($args[0] === 'xdt3'){ | |
| $forceId = isset($args[1]) ? 66 : null; |
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 DoubleChestDebug | |
| * @main muqsit\dcdcd\Main | |
| * @version 1.0 | |
| * @api 3.0.0 | |
| */ | |
| namespace muqsit\dcdcd { | |
| use pocketmine\plugin\PluginBase; |
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 | |
| class A { | |
| /** @var \SplFixedArray */ | |
| public $array; | |
| public function __construct(){ | |
| $this->array = new \SplFixedArray(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 | |
| namespace villagertrade; | |
| use pocketmine\entity\Villager; | |
| use pocketmine\inventory\BaseInventory; | |
| use pocketmine\item\Item; | |
| use pocketmine\nbt\NetworkLittleEndianNBTStream; | |
| use pocketmine\nbt\tag\{ByteTag, CompoundTag, IntTag, ListTag}; | |
| use pocketmine\network\mcpe\protocol\UpdateTradePacket; | |
| 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 | |
| /** | |
| * Source from: | |
| * https://github.com/NiclasOlofsson/MiNET/blob/master/src/MiNET/MiNET/Utils/TextUtils.cs | |
| */ | |
| namespace cosmiccore\miscs; | |
| use pocketmine\utils\TextFormat as TF; | |
| class StringUtils { |
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 | |
| //This is the redis database being selected | |
| //Databases in redis are integers (0-15) unlike | |
| //mysql where the database can be a string | |
| const REDIS_DATABASE = 0; | |
| $redis = new \Redis();// https://github.com/phpredis/phpredis | |
| $redis->connect("127.0.0.1"); |