Skip to content

Instantly share code, notes, and snippets.

@shoghicp
shoghicp / gist:3121930
Created July 16, 2012 10:11
Test PHP CLient for Minecraft
$client = new MinecraftClient("127.0.0.1");
$client->event("onTick", "spammer");
$client->connect("troll", "trollpassword");
function spammer($data, $event, $ob){
$ob->say("SPAM!!");
}
@shoghicp
shoghicp / 0x84.txt
Created October 21, 2012 21:08
0x84 Minecraft PE Compilation
//Packet 0x84 compilation
//Client -> Server
//Server ID ffffffffd7189931
00 00004000 9000000009 ffffffffd7189931 4273a8508fa03694 00
//Server -> Client
protected function _shiftIV($IV, $str){ //Only for CFB
if(strlen($str) < 16){
$len = min($this->IVLenght, strlen($str));
return substr($IV, $len).substr($str, -$len);
}
return substr($str, -$this->IVLenght);
}
@shoghicp
shoghicp / IO.php
Created January 12, 2013 12:24
async PHP Console I/O, Needs pthreads https://github.com/krakjoe/pthreads/
<?php
if(!extension_loaded("pthreads") and @dl((PHP_SHLIB_SUFFIX === "dll" ? "php_":"") . "pthreads." . PHP_SHLIB_SUFFIX) === false){
trigger_error("Unable to find pthreads extension", E_USER_ERROR);
exit(1);
}
function kill($pid){
$uname = strtoupper(php_uname("s"));
@shoghicp
shoghicp / WorldEditor.php
Last active December 12, 2015 09:19
WorldEditor 0.4dev for PocketMine-MP Alpha_1.2dev API #2
<?php
/*
__PocketMine Plugin__
name=WorldEditor
description=World Editor is a port of WorldEdit to PocketMine
version=0.4dev
author=shoghicp
class=WorldEditor
apiversion=3
           -
         /   \
      /         \
   /   PocketMine  \
/          MP         \
|\     @shoghicp     /|
|.   \           /   .|
| ..     \   /     .. |
| .. | .. |
This file has been truncated, but you can view the full file.
'use strict';
var COMPILED = !0, goog = goog || {};
goog.global = this;
goog.DEBUG = !1;
goog.LOCALE = "en";
goog.provide = function (a) {
if (!COMPILED) {
if (goog.isProvided_(a))
throw Error('Namespace "' + a + '" already declared.');
delete goog.implicitNamespaces_[a];
@shoghicp
shoghicp / MagicCarpet.php
Last active December 15, 2015 17:59
MagicCarpet plugin
<?php
/*
__PocketMine Plugin__
name=MagicCarpet
description=MagicCarpet is a plugin that allows the user to fly away on a carpet made of glass (port)
version=0.1.2
author=shoghicp
class=MagicCarpet
apiversion=5,6
@shoghicp
shoghicp / Questions.md
Last active December 15, 2015 18:09
Questions for the livestream ;) http://www.twitch.tv/jbernhardsson

MCPE 0.7.0 Livestream Questions & Answers

Other people questions

Buckets?

  • Answer: We'll like to implement that for this update

Redstone?

  • Answer: In the future
dnl +----------------------------------------------------------------------+
dnl | PHP Version 5 |
dnl +----------------------------------------------------------------------+
dnl | Copyrght (C) 1997-2013 The PHP Group |
dnl +----------------------------------------------------------------------+
dnl | This source file is subject to version 3.01 of the PHP license, |
dnl | that is bundled with this package in the file LICENSE, and is |
dnl | available through the world-wide-web at the following url: |
dnl | http://www.php.net/license/3_01.txt |
dnl | If you did not receive a copy of the PHP license and are unable to |