Skip to content

Instantly share code, notes, and snippets.

@JackNoordhuis
JackNoordhuis / SplClassLoader.php
Last active August 12, 2016 07:32 — forked from jwage/SplClassLoader.php
Add MIT license.
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
@JackNoordhuis
JackNoordhuis / PC2PE.py
Last active August 30, 2016 11:35 — forked from TruDan/PC2PE.py
MCEdit Filter to convert PC worlds to PE. Note: This does NOT convert the world to MCRegion format.
displayName = "PC -> PE"
replaceBlocks = {
119: 0, # End portal frame
122: 0, # Dragon egg
125: 157, # Double wooden slab
126: 158, # Wooden slab
130: 54, # Enderchest
137: 0, # Command block
138: 0, # Beacon
@JackNoordhuis
JackNoordhuis / compare.php
Last active November 5, 2016 02:52
Compare version strings easily
<?php
function compare($old, $new) {
$oldNumbers = explode(".", $old);
$newNumbers = explode(".", $new);
$hasNewVersion = false;
for($i = 0; $i < 3; $i++) {
if($newNumbers[$i] > $oldNumbers[$i]) {
@JackNoordhuis
JackNoordhuis / [PocketMine] Attributes exceeds range error.txt
Last active December 5, 2016 06:48
Attribute exceeding range error
[06:57:52] [Server thread/DEBUG]: Packet pocketmine\network\protocol\LoginPacket 0xfe010000005b008b1478daed9b5b73da4816c753b56ffb15f62d8f5b3553920007ed3e19a11602a931bab4506f6da5001174050c58064ded775f61b5485a696b003be329671efa810ac7529f5fffcfadc33ffff6e1c36f1f67fe24587efcd77f3ece0f7d7faacc8261d00776a637a1a46ed5e582f74cf5468d78d5197b608462d514c489395edfeb32ecd82856cccc00860dbaa66d60cc0130477e6f6ee31694d7aad3c37738b20f16ba6d8e32e0cc223e8132b0ece58c77144f9b665e6623231e3afd951bc54d24c0eea0813853d8d9585e1d500f614ff6561a075653e0cb83c63a9c297c730ee496676f375a06052bdaaf8da587b1006cd8884dc7027796057b06077b7365971a3d039b09af4e7afdae95801436e0e3147492a9b508be8c56bfe6fb8ee7bddb6018cadcb07bdbd22df700b3d9564d50d3ebf57d43019c9bfb20ff5e3419e7b60a68e57f67879ffcb2f65d61379c0ae2012b3e3f19eb8126f5d758410f9e1273f3e3771257183ac8875d97d7ac38d6bbfa4ecfecbd7be05ad07205cdf22398b98f308b1ef5f0f6a01ffa22f53750877793fddae576f1fc1db3c8f7fce0266e850316a5c5af375f1e20f78947c2ae7f73ab6eb5ddd86a089a32731e5280502bbde71fdc417a3707da586a3be24372b3f
@JackNoordhuis
JackNoordhuis / fac.sh
Last active January 24, 2017 05:22
Longest bash command I've ever used lol
echo -e "makeplugin AdvancedKits\nmakeplugin AlwaysSpawn\nmakeplugin BlockBreaker\nmakeplugin Broadcaster\nmakeplugin BuyCraft\nmakeplugin ClearLagg\nmakeplugin CombatLogger\nmakeplugin CPEFactions\nmakeplugin CPEPerks\nmakeplugin CPETPA\nmakeplugin Crates\nmakeplugin CustomAlerts\nmakeplugin DevTools\nmakeplugin EconomyAPI\nmakeplugin EconomySell\nmakeplugin EconomyShop\nmakeplugin EnchantSignPE\nmakeplugin Envoys\nmakeplugin Farms\nmakeplugin FNPC\nmakeplugin Genisys-DevTools\nmakeplugin iProtector\nmakeplugin ManyWorlds\nmakeplugin MCPEMMO\nmakeplugin NetherChests\nmakeplugin PureChat\nmakeplugin PurePerms\nmakeplugin QuiteCommand\nmakeplugin SpecialBlock\nmakeplugin StackingMobs\nmakeplugin supertext\nmakeplugin VoteReward\nmakeplugin WorldProtect\nmakeplugin WowItems\nstop" | bin/php7/bin/php src/pocketmine/PocketMine.php --no-wizard --disable-ansi --debug.level=2
@JackNoordhuis
JackNoordhuis / Usage.txt
Last active February 8, 2018 12:28
Simple bash script to install PocketMine straight from GitHub
Usage:
Install source: ./github-installer.sh
Install compiled server Phar without source: ./github-installer.sh --compile --no-source
Install DevTools and compiled server Phar with source: ./githubinstaller.sh --devtools --compile
Install DevTools and compiled server Phar without source: ./github-installer.sh --devtools --compile --no-source
@JackNoordhuis
JackNoordhuis / gist:fe75b6f008531c785642bffc7dd9666b
Created March 24, 2017 14:06
Fri_Mar_24-17.54.37-EDT_2017.log
PocketMine-MP Crash Dump Fri Mar 24 17:54:37 EDT 2017
Error: Call to a member function addEntityMovement() on null
File: /src/pocketmine/Player
Line: 1468
Type: notice
Code:
[1459] if(!$isFirst){
[1460] $ev = new PlayerMoveEvent($this, $from, $to);
@JackNoordhuis
JackNoordhuis / packets.json
Last active April 26, 2017 07:41
Extropy packet definitions
{
"Login": {
"protocols": {
"107": {
"pid": "0x01",
"canBatch": false,
"canSendBeforeLogin": true,
"minecraft-versions": [
"1.0.7.0"
],
<?php
/*
* Data in the form of: x y z\nx y z
*/
$data =
'384 1 -71
383 1 -26
384 1 25
383 1 70
480 1 -71
@JackNoordhuis
JackNoordhuis / garry.php
Created August 10, 2017 08:42
hold this L boi
<?php
Class Gary extends YouTuber {
private $isSnail = false;
private $hasClickbaitContent = false;
public function setIsSnail(bool $value = true) {
$this->isSnail = $value;
}