Skip to content

Instantly share code, notes, and snippets.

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

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 Jul 4, 2018
This code will: Recreate lost signs, furnaces and chests, and remove invalid or corrupt tile entities from a world.
View worldFixer.php
<?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 Mar 17, 2016
RC4 implementation in PHP, without run-time notices or errors. Outputs keystream directly. http://en.wikipedia.org/wiki/RC4
View 3lines.php
<?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);}
View commandOverride.md

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 Aug 18, 2014
Minecraft: PE v0.9.5 possible bugs
View bugs.md

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 Aug 18, 2014
Minecraft: PE v0.9.5 possible bugs
View bugs.md

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 Aug 18, 2014
Minecraft: PE v0.9.5 possible bugs
View bugs.md

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 Aug 18, 2014
Minecraft: PE v0.9.5 possible bugs
View bugs.md

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