Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
#PocketMine automatic analysis tool
echo "[*] PocketMine automatic analysis tool"
cat > ttyecho.c <<'TTYECHO'
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
<?php
$world = $this->getServer()->getDefaultLevel();
$radius = 136;
$total = (($radius * 2) + 1) ** 2;
$count = 0;
$bList = clone \pocketmine\block\Block::$list;
$search = [];

Keybase proof

I hereby claim:

  • I am shoghicp on github.
  • I am shoghicp (https://keybase.io/shoghicp) on keybase.
  • I have a public key whose fingerprint is 7E68 21B8 74F3 325D D2CD 2719 BD68 8354 33DA BBE5

To claim this, I am signing this object:

@shoghicp
shoghicp / worldFixer.php
Last active July 4, 2018 12:16
This code will: Recreate lost signs, furnaces and chests, and remove invalid or corrupt tile entities from a world.
<?php
$world = $this->getServer()->getDefaultLevel();
$radius = 80;
$total = (($radius * 2) + 1) ** 2;
$count = 0;
for($chunkX = -$radius; $chunkX <= $radius; ++$chunkX){
for($chunkZ = -$radius; $chunkZ <= $radius; ++$chunkZ){
$chunk = $world->getChunk($chunkX, $chunkZ, false);
if($chunk instanceof \pocketmine\level\format\FullChunk and $chunk->isPopulated()){
$tiles = [];
@shoghicp
shoghicp / 3lines.php
Last active March 17, 2016 06:10
RC4 implementation in PHP, without run-time notices or errors. Outputs keystream directly. http://en.wikipedia.org/wiki/RC4
<?php
for($K='Key',$_=range($i=$j=0,$n=255);$i<=$n;$j+=$_[$i]+ord($K{$i%strlen($K)}),_($_[$j&=$n],$_[$i++]));
for($j=$i=0;++$i;$j+=$_[$i&=$n],_($_[$j&=$n],$_[$i]),printf('%x',$_[($_[$i]+$_[$j])&$n]));
function _(&$i,&$j){$i=$j+$i-($j=$i);}

You want to override the tell command, that has also the w and msg aliases by default. The class that will override these commands is MyTellCommand (extends PluginCommand).

To do this, you've to set the original command in a state that allows it to be overriden. Also, aliases will be registered directly, but since all the work was done for the first registration, it's pretty simple.

//We are in the context of a plugin
@shoghicp
shoghicp / bugs.md
Created August 18, 2014 21:29
Minecraft: PE v0.9.5 possible bugs

MovePlayerPacket sends weird yaw values

  • Step 1: Rotate the head in one direction multiple times
  • Step 2: Get MovePlayerPacket with yaw > 360, example: 6407.0166015625
  • This can cause rounding errors after too many rotations

NULL UpdateBlockPacket is sent by the client randomly

  • Step 1: ??? (happens in vanilla and PocketMine)
  • Step 2: Get an UpdateBlockPacket with x, y, z, blockId, blockData all 0 (null)
  • This packet is not meant to be sent by clients, it's only Server -> Client
@shoghicp
shoghicp / bugs.md
Created August 18, 2014 21:19
Minecraft: PE v0.9.5 possible bugs

MovePlayerPacket sends weird yaw values

  • Step 1: Rotate the head in one direction multiple times
  • Step 2: Get MovePlayerPacket with yaw > 360, example: 6407.0166015625
  • This can cause rounding errors after too many rotations

NULL UpdateBlockPacket is sent by the client randomly

  • Step 1: ??? (happens in vanilla and PocketMine)
  • Step 2: Get an UpdateBlockPacket with x, y, z, blockId, blockData all 0 (null)
  • This packet is not meant to be sent by clients, it's only Server -> Client
@shoghicp
shoghicp / bugs.md
Created August 18, 2014 21:17
Minecraft: PE v0.9.5 possible bugs

MovePlayerPacket sends weird yaw values

  • Step 1: Rotate the head in one direction multiple times
  • Step 2: Get MovePlayerPacket with yaw > 360, example: 6407.0166015625
  • This can cause rounding errors after too many rotations

NULL UpdateBlockPacket is sent by the client randomly

  • Step 1: ??? (happens in vanilla and PocketMine)
  • Step 2: Get an UpdateBlockPacket with x, y, z, blockId, blockData all 0 (null)
  • This packet is not meant to be sent by clients, it's only Server -> Client
@shoghicp
shoghicp / bugs.md
Created August 18, 2014 21:17
Minecraft: PE v0.9.5 possible bugs

MovePlayerPacket sends weird yaw values

  • Step 1: Rotate the head in one direction multiple times
  • Step 2: Get MovePlayerPacket with yaw > 360, example: 6407.0166015625
  • This can cause rounding errors after too many rotations

NULL UpdateBlockPacket is sent by the client randomly

  • Step 1: ??? (happens in vanilla and PocketMine)
  • Step 2: Get an UpdateBlockPacket with x, y, z, blockId, blockData all 0 (null)
  • This packet is not meant to be sent by clients, it's only Server -> Client