Skip to content

Instantly share code, notes, and snippets.

The LegionPE Hub Plugin

Copyright (C) 2014 PEMapModder (a.k.a. mcpesrccode and MCPE_modder_for_maps)

You may not distribute or use this software or its modifications without prior permission from PEMapModder or MCPE_modder_for_maps from http://formus.pocketmine.net or http://minecraftforum.net or https://github.com.

===

The main plugin (Hub.php) contains the following features:

FAQ for LegionPE Theta

What will be different?

Everything will become different. Our server will be splitted into multiple servers, each being one of the following types:

  • hub
  • classic
  • KitPvP
  • parkour
  • spleef
# RedstoneLamp Protocol Documentation File
# In this way you can make comments with the # sign
# Just indent this file in any sizes and we still accept it!
# Note that you may not use # as the comment sign at the middle of a line!
ProtocolName Minecraft NokiaEdition V01
# ProtocolName <protocol name ...>
ProtocolDescription this is an example protocol.\
@PEMapModder
PEMapModder / YJRW.php
Last active January 25, 2016 13:10
A YAML/JSON reader/writer
<?php
$console = fopen("php://stdin", "r");
$running = true;
while($running){
$line = trim(fgets($console));
if($line){
// echo "Command issued: \"$line\"".PHP_EOL;
$args = explode(" ", $line);
switch($cmd = strtolower(trim(array_shift($args)))){
@PEMapModder
PEMapModder / index.php
Created June 15, 2015 07:47
Legion PE status generator, hosted at http://lgpe.co/status/
<?php
$begin = microtime(true);
const NORM = "/var/www/html/sgn/norm.ttf";
const BOLD = "/var/www/html/sgn/bold.ttf";
const X_INTERVAL = 6;
const LEFT_PADDING = 80;
const RIGHT_PADDING_24 = 325;
const RIGHT_PADDING_SLOTS = 350;
const TOP_PADDING = 100;
const BOTTOM_PADDING_24 = 80;
@PEMapModder
PEMapModder / todo-cmds.md
Last active January 25, 2016 13:09
Commands redo list
  • version
  • tell
  • ban // TODO deprecate and replace with backwards compatibility (advanced warnings)
  • pardon // TODO deprecate and replace with backwards compatibility (advanced warnings)
  • say
  • me
  • kick
  • give // TODO permissions
  • effect // TODO permissions
  • particle // TODO permissions
<?php
$statement = false; // false; a lie
if($statement === true){ // if $statement is true
$fact = $statement; // the fact is exactly that statement.
}else{ // else, i.e. $statement is false
$fact = !$statement; // the fact is the opposite (NOT; !) of $statement
}
@PEMapModder
PEMapModder / compile.sh
Last active January 25, 2016 13:05 — forked from shoghicp/compile.sh
PHP7.0.1 + pthreads 3.1.5 + YAML + other stuff needed to run PocketMine. Experimental
#!/bin/bash
[ -z "$PHP_VERSION" ] && PHP_VERSION="7.0.1"
ZEND_VM="GOTO"
ZLIB_VERSION="1.2.8"
POLARSSL_VERSION="1.3.8"
LIBMCRYPT_VERSION="2.5.8"
GMP_VERSION="6.0.0a"
GMP_VERSION_DIR="6.0.0"
CURL_VERSION="curl-7_44_0"
@PEMapModder
PEMapModder / pmt meta.md
Last active January 25, 2016 13:04
pmt.mcpe.me "pmt" property

In the future, if users are converting phars into zips via pmt.mcpe.me, developers can require the users to agree with their terms before downloading the extraction.

The terms are composed of two parts, namely "lock" and "key". When a user clicked the Convert button of the webpage submitting a phar that requires agreeing with terms, he will get a prompt that shows the content of the "lock". To continue and download the zip, he has to enter the "key" into the prompt.

There are currently three simple ways to add lock-and-key into your phar:

plugin.yml

If your plugin is compiled with pmt.mcpe.me, you can add this into your plugin.yml:

@PEMapModder
PEMapModder / mysqli.php
Created January 20, 2016 11:13
Simple MySQL client written in PHP
#!/usr/bin/env php
<?php
if(!defined("STDIN")) define("STDIN", fopen("php://stdin", "R"));
$host = "localhost";
$user = "root";
$password = "";
$schema = "";
$opts = getopt("h:u:p:s:");