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 |
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); | |
class a | |
{ | |
/** @var string */ | |
private static $foo; | |
public static function getFoo(): string |
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 | |
$rightClickBlockFilter = function (PlayerInteractEvent $event) use ($player): bool { | |
return $event->getPlayer() === $player && $event->getAction() === PlayerInteractEvent::RIGHT_CLICK_BLOCK; | |
}; | |
$ignoreCancelled = function (Cancellable $cancellable): bool { | |
return !$cancellable->isCancelled(); | |
}; |
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 | |
start($this)->run(function () { | |
while (true) { | |
/** @var PlayerEditBookEvent $event */ | |
$event = yield listen(PlayerEditBookEvent::class); | |
if ($event->getAction() !== PlayerEditBookEvent::ACTION_SIGN_BOOK) { | |
continue; | |
} | |
$book = $event->getNewBook(); |
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 | |
start($this)->run(function () { | |
$lastTick = []; | |
while (true) { | |
return; | |
/** @var PlayerInteractEvent $event */ | |
$event = yield listen(PlayerInteractEvent::class); | |
$player = $event->getPlayer(); | |
$name = $player->getName(); |
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); | |
start($this)->run(function (EventStream $eventStream) { | |
while (true) { | |
/** @var PlayerJoinEvent $event */ | |
$event = yield listen(PlayerJoinEvent::class); | |
$player = $event->getPlayer(); | |
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 | |
/** | |
* @license GNU Lesser General Public License v2.1 | |
* @author FlowyProject(https://github.com/FlowyProject/) | |
*/ | |
declare(strict_types=1); | |
namespace PJZ9n\Example; |
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 Particle\Validator\Validator; | |
$input = [ | |
"enabled" => true, | |
"items" => [ | |
[ |
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 Example; | |
use pocketmine\block\Block; | |
use pocketmine\event\block\BlockBreakEvent; | |
use pocketmine\event\Listener; | |
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 | |
/** @var \pocketmine\level\Level $level */ | |
$pos = new Vector3(1, 2, 3); | |
$item = ItemFactory::get(Item::STONE); | |
$level->dropItem($pos, $item); |