Skip to content

Instantly share code, notes, and snippets.

View TheNewHEROBRINEX's full-sized avatar

TheNewHEROBRINE TheNewHEROBRINEX

  • Italy
  • 12:38 (UTC +02:00)
View GitHub Profile
2016-12-31 [14:19:32] [Server thread/WARNING]: Non-packaged PocketMine-MP installation detected, do not use on production.
2016-12-31 [14:19:32] [Server thread/INFO]: Loading pocketmine.yml...
2016-12-31 [14:19:32] [Server thread/INFO]: Loading server properties...
2016-12-31 [14:19:32] [Server thread/INFO]: Selected English (eng) as the base language
2016-12-31 [14:19:32] [Server thread/INFO]: Starting Minecraft: PE server version v1.0.0.16
2016-12-31 [14:19:32] [Server thread/INFO]: Opening server on 0.0.0.0:21256
2016-12-31 [14:19:32] [Server thread/INFO]: This server is running PocketMine-MP version 1.6.2dev "Unleashed" (API 3.0.0-ALPHA1)
2016-12-31 [14:19:32] [Server thread/INFO]: PocketMine-MP is distributed under the LGPL License
2016-12-31 [14:19:32] [Server thread/INFO]: Loading recipes...
2016-12-31 [14:19:34] [Server thread/NOTICE]: Level "world" not found
<?php
$skindata = base64_decode(file_get_contents("/Users/luca/Desktop/skindata.txt"));
$colors = str_split($skindata, 4);
$height = count($colors) / 64;
$skin = imagecreatetruecolor(64, $height);
$allocatedColors = array();
foreach ($colors as $color) {
str_split($color);
$red = hexdec(bin2hex($color[0]));
<?php
public function onPreCommand(PlayerCommandPreprocessEvent $event) {
$message = $event->getMessage();
if ($message{0} == "/") {
$offset = 1; // /comando
}
elseif (substr($message, 0, 2) == "./") {
$offset = 2; // ./comando
}
else {
<?php
/**
* @name WorldNamesFixer
* @main TheNewHEROBRINE\WorldNamesFixer\Main
* @version 1.0.0
* @api 3.0.0-ALPHA7
* @author TheNewHEROBRINE
*/
#!/usr/bin/env php
<?php
$opts = getopt("", ["phar:", "target:"]);
if(!isset($opts["phar"]) or !isset($opts["target"])) {
exit(1);
}
$pharPath = "phar://".$opts["phar"];
$folderPath = $opts["target"].DIRECTORY_SEPARATOR.basename($opts["phar"], ".phar");
foreach(new RecursiveIteratorIterator(new RecursiveDirectoryIterator($pharPath)) as $fInfo){
$path = $fInfo->getPathname();
@TheNewHEROBRINEX
TheNewHEROBRINEX / file.php
Last active December 23, 2017 23:43
Get plugin commands
<?php
array_unique(array_map(function ($command) {
/** @var Command $command */
return $command->getName();
}, array_filter($cmds = $this->getServer()->getCommandMap()->getCommands(), function ($command) use($plugin, $cmds) {
/** @var Command $command */
return $command instanceof PluginIdentifiableCommand and $command->getPlugin() === $plugin or isset($cmds[strtolower($plugin->getName() . ":" . $command->getName())]);
})));
name: string
version: string
main: string
api: string[]|string
mcpe-protocol: int[]|int
commands:
string:
description: string
usage: string
aliases: string[]
<?php
const WRAPPER = "\xfe\xfd";
const SESSIONID = "\x01\x02\x03\x04";
const HANDSHAKE = "\x09";
const STATISTICS = "\x00";
function queryPMMPServer(string $ip, int $port = 19132): array {
$socket = fsockopen("udp://" . gethostbyname($ip), $port, $errno, $errstr);
function message {
echo "[*] $1"
}
message "PocketMine-MP sta per essere installato nella cartella corrente (`pwd`)"
read -p "Premi invio per iniziare l'installazione...
"
message "Download dei binari PHP..."
wget https://jenkins.pmmp.io/job/PHP-8.0-Linux-x86_64/lastSuccessfulBuild/artifact/PHP_Linux-x86_64.tar.gz
tar xzf PHP_Linux-x86_64.tar.gz
<?php
public function onItemPickup(InventoryPickupItemEvent $event) : void{
$inventory = $event->getInventory();
if($inventory instanceof PlayerInventory){
$player = $inventory->getHolder();
if($player instanceof Player){
$murderPlayer = $this->plugin->findMurderPlayer($player);
$itemEntity = $event->getItem();
$itemItem = $itemEntity->getItem();
if($murderPlayer instanceof MurderPlayer){