Skip to content

Instantly share code, notes, and snippets.

@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:

<?php
/**
* @name ServerKiller
* @author PEMapModder
* @version 2.0.0
* @api 2.0.0
* @main ServerKiller\ServerKiller
*/
@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 / plugin.yml
Last active December 12, 2015 14:38
SkinKick - Auto-generated gist plugin stub by pmt.mcpe.me InstaPlugin
---
name: SkinKick
author: PEMapModder
version: "1.0"
api:
- 1.13.0
main: PEMapModder\SkinKick\Main
commands:
newskin:
usage: /ns
@PEMapModder
PEMapModder / dot.php
Last active November 18, 2015 14:44
<?php
/**
* @param number $x the X coordinate of the center of the circle
* @param number $y the Y coordinate to place particles at
* @param number $z the Z coordinate of the center of the circle
* @param number $radius the distance for each dot from the center
* @param number $step the angle per step, in degrees
* @param callable $callback the function to call for each dot, with parameters $x, $y, $z representing the coordinates of the dot
*/
//class elementalLaserSubclass extends ElementsPE{ // incorrect usage
ModPE.setItem(511,12,5,"Elemental Laser Gun");//did i misplace x and y? but pleas. i am terrible at arts
ModPE.setItem(510,13,5,"Elemental Laser Gun Batteries");
ModPE.setItem(509,14,5,"Elemental Explosive Laser Gun");
ModPE.setItem(508,15,5,"Elemental Explosive Laser Gun Batteries");
function useItem(a,b,c,d) /*extends ElementsPE.useItem(double,double,double,int,int,int)*/{
if(d==511/*laser gun*/&&getInventoryItemCount(510,0,false)>0){
shootLaser(getPlayerX(),getPlayerY(),getPlayerZ(),getYaw(),getPitch()*-1,readData(Level.getWorldDir()+"preference.accuracy.laser"),readData(Level.getWorldDir()+"preference.laser.type"));
}
}
So far I made something like this: (I just started half an hour ago, so this is my efficiency)
<?php
/*
__PocketMine Plugin__
author=PEMapModder
name=SpleefPlugin
version=alpha.0.0
apiversion=11
class=SpleefPluginLoadable
*/
diff --git a/LegionPE-Core/src/legionpe/MysqlConnection.php b/LegionPE-Core/src/legionpe/MysqlConnection.php
index 8955058..67eb3e5 100644
--- a/LegionPE-Core/src/legionpe/MysqlConnection.php
+++ b/LegionPE-Core/src/legionpe/MysqlConnection.php
@@ -2,7 +2,10 @@
namespace legionpe;
-class MysqlConnection {
+class MysqlConnection{

How to generate a username for MCPE players

  1. For ?% chance, add the prefix xX and suffix Xx
  2. Choose a random item/mechanism/entity name from MCPE
  3. Choose a random word from the dictionary
  4. For ?% chance, choose a random from common given names
  5. For ?% chance, add the words girl or cute or cool or kid or boy
  6. For ?% chance, add the word MCPE
  7. For ?% chance, add the word Itz or Its
  8. For 99% chance, change all occurrences of s to z to make it sound like more professional/special while it isn't at all
$ php -r '$files = [];
foreach(new RecursiveITeratorIterator(new RecursiveDirectoryIterator(".")) as $file){ if(is_file($file) and filesize($file) <= 4096) $files[basename($file)] = filesize($file) / 1024; }
arsort($files);
print_r($files);'
Array
(
[PharPluginLoader.php] => 3.9365234375
[SendUsageTask.php] => 3.9208984375
[FormattedCommandAlias.php] => 3.89453125
[QueryHandler.php] => 3.8857421875