Skip to content

Instantly share code, notes, and snippets.

@PEMapModder
PEMapModder / PocketMine_all.php
Created April 23, 2014 03:11
All of PocketMine, archieved
This file has been truncated, but you can view the full file.
<?php
$web = 'index.php';
if (in_array('phar', stream_get_wrappers()) && class_exists('Phar', 0)) {
Phar::interceptFileFuncs();
set_include_path('phar://' . __FILE__ . PATH_SEPARATOR . get_include_path());
Phar::webPhar(null, $web);
include 'phar://' . __FILE__ . '/' . Extract_Phar::START;
return;

PEMapmodder's Current Projects (PocketMine Plugins)

  • LegionPE Zekkou Cake new plugin
  • After finishing this, I will start on a public API for all servers free to use (with credit). This API allows plugins to register subclasses of Minigame's as minigames and co-work with each other.
  • xEcon
  • Factions
  • PocketRealisticMulti
@PEMapModder
PEMapModder / LegionPE Hub Core.php
Created June 10, 2014 10:52
A snapshot of LegionPE hub's core code
<?php
class HubPlugin extends PluginBase{
public function onChat(PlayerChatEvent $event){ // if session is not self::HUB, monitor it. if session is self::HUB, prevent typing password here
$p = $event->getPlayer();
if(($s = $this->sessions[$p->getID()]) < self::HUB or $s >= self::LOGIN){ // if not authed
$event->setCancelled(true);
}
elseif($this->getDb($p)->get("pw-hash") === $this->hash($event->getMessage())){ // if authed but is telling password
$event->setCancelled(true);
$p->sendMessage("Never talk loudly to others your password!");
@PEMapModder
PEMapModder / LegionPE Delta Outline.md
Last active August 29, 2015 14:02
Know more about LegionPE Delta (LegionPE after 0.9.0)

LegionPE Delta

When will it be released?

The date MCPE 0.9.0 is released on iOS and Android is in July I think. PocketMine-MP Alpha_1.4 (Zekkou Cake) will be released not long (probably one or two days) after the release of 0.9.0. Since 0.9.0 can only be connected with servers hosted with Zekkou Cake, we have to update our plugins to support Zekkou Cake. Our promise is at most one week after the release of Zekkou Cake, but as you know, bugs are never predictable and we may come into bugs that take days to solve.

Currently (14/6/2014), the basic structure of the new API plugin is finished and debugged except chat control, which hopefully will only take 3 to 4 hours to debug. Parkour is fully finished and believed to be stable and hopefully will take no more than 15 minutes to debug. Spleef is finished, but it is based on a proof of concept of spleef arena objects by @PEMapModder, so it may take one or two days to finish debugging, and in worst ccircumstances it may need to be rewrited, which

<?php
require_once(dirname(__FILE__)."/Table.php");
$table = new \legendofmcpe\statscore\Table(dirname(__FILE__)."/table.txt");
$table->set("test1", 0, "row one");
$table->set("test2", 0, "row two");
$table->set("test1", 1, true);
$table->set("test2", 1, "true");
$table->save();
@PEMapModder
PEMapModder / IceBucketChallenge.js
Last active August 29, 2015 14:05
Simple ice bucket challenge plugin in PocketMine/ModPE xD
var others = [
"sheep",
"pig",
"cow",
"chicken",
"zombie",
"skeleton",
"spider",
"creeper",
"zombie pigman",
<?php
class BSFReader extends StringReader{
public function readItem(){
$data = unpack("nid/Cdamage/Ccount/Imetadata", $this->read());
$count = $data["metadata"];
$data["metadata"] = [];
for($i = 0; $i < $count; $i++){
$key = $this->readString(2);
$data["metadata"][$key] = $this->readString(2);
dispatcher.registerCommand(
literal("scoreboard").then(
literal("players").then(
literal("reset").then(
argument("players", players()).then(
optional("objective", objective())
).executes(SOME_COMMAND)
)
).then(
literal("list").then(
@PEMapModder
PEMapModder / How to implement plugin permissions.md
Created December 20, 2014 07:59
How to implement plugin permissions (for all servers written in OOP languages with PocketMine-style API: commands, events, schedules) in code for access to API functions

How to implement plugin permisisons (for all servers written in OOP languages with PocketMine-style API: commands, events, schedules) in code for access to API functions

The principle of this system is to make use of the characteristic of executing code on one thread - code flows single-direction - to identify what context (server or what plugin or what) the code is flowing to currently and decide whether the current context has permission to do something.

First, the server has to declare a class that extends a class called Context and instantiate an object that has any permissions. The object serves as a lock and shall not be accessible by plugins. Every object that represents a plugin (but these objects must not be declared by the plugin) should have a context too. This is an example for the Context class in Java:

import java.util.List;

public class Context{
@PEMapModder
PEMapModder / legionpe.agenda.md
Created January 8, 2015 07:21
PEMapModder's agenda on LegionPE

PEMapModder's Agenda on LegionPE

  • Basic KitPvP things
  • Friends
  • W.I.P. Shops, hopefully done at the end of January 2015
  • Spleef, hopefully done in Feburary
  • Infected; not sure when I will get it done, or when the map is ready
  • KitPvP teams; we may as well extend this to Spleef and Infected too
  • Parkour; no offense whoever created it but it didn't look promising to me. Anyway when I have enough time I will work on it if I have enough resources.