├── .gitattributes ├── .gitignore ├── LICENSE ├── README ├── classes ├── AES.class.php ├── ASNValue.class.php ├── Anvil.class.php ├── Entity.class.php ├── MapInterface.class.php ├── McRegion.class.php ├── MinecraftClient.class.php ├── MinecraftInterface.class.php ├── Packet.class.php ├── Path.class.php ├── Socket.class.php ├── Utils.class.php ├── Window.class.php └── phpseclib │ ├── Crypt │ ├── AES.php │ ├── DES.php │ ├── Hash.php │ ├── RC4.php │ ├── RSA.php │ ├── Random.php │ └── Rijndael.php │ ├── File │ ├── ANSI.php │ ├── ASN1.php │ └── X509.php │ ├── Math │ └── BigInteger.php │ └── openssl.cnf ├── client.php ├── config.php ├── docs ├── events.txt └── methods.txt ├── example.php ├── misc ├── biomes.php ├── dependencies.php ├── entities.php ├── functions.php └── materials.php ├── plugin ├── AdvertManager.plugin.php ├── Attack.plugin.php ├── CacheFile.plugin.php ├── ChatCommand.plugin.php ├── ChatHandler.plugin.php ├── CleverBot.plugin.php ├── Follow.plugin.php ├── LagOMeter.plugin.php ├── LastLogin.plugin.php ├── MapPainter.plugin.php ├── Navigation.plugin.php ├── NoHunger.plugin.php ├── PathFind.plugin.php ├── QuestionFAQ.plugin.php ├── Record.plugin.php ├── RemoteConsole.plugin.php └── Stats.plugin.php └── pstruct ├── 22.php ├── 23.php ├── 28.php ├── 29.php ├── 38.php ├── 39.php ├── 40.php ├── 41.php ├── 42.php ├── 43.php ├── 44.php ├── 45.php ├── 46.php ├── 47.php ├── 48.php ├── 49.php ├── 51.php ├── 60.php ├── packetName.php └── spout.php /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | cmd.bat 2 | *.log 3 | *.ini 4 | smallClient 5 | data/* 6 | 7 | ################# 8 | ## Eclipse 9 | ################# 10 | 11 | *.pydevproject 12 | .project 13 | .metadata 14 | bin/ 15 | tmp/ 16 | *.tmp 17 | *.bak 18 | *.swp 19 | *~.nib 20 | local.properties 21 | .classpath 22 | .settings/ 23 | .loadpath 24 | 25 | # External tool builders 26 | .externalToolBuilders/ 27 | 28 | # Locally stored "Eclipse launch configurations" 29 | *.launch 30 | 31 | # CDT-specific 32 | .cproject 33 | 34 | # PDT-specific 35 | .buildpath 36 | 37 | 38 | ################# 39 | ## Visual Studio 40 | ################# 41 | 42 | ## Ignore Visual Studio temporary files, build results, and 43 | ## files generated by popular Visual Studio add-ons. 44 | 45 | # User-specific files 46 | *.suo 47 | *.user 48 | *.sln.docstates 49 | 50 | # Build results 51 | [Dd]ebug/ 52 | [Rr]elease/ 53 | *_i.c 54 | *_p.c 55 | *.ilk 56 | *.meta 57 | *.obj 58 | *.pch 59 | *.pdb 60 | *.pgc 61 | *.pgd 62 | *.rsp 63 | *.sbr 64 | *.tlb 65 | *.tli 66 | *.tlh 67 | *.tmp 68 | *.vspscc 69 | .builds 70 | *.dotCover 71 | 72 | ## TODO: If you have NuGet Package Restore enabled, uncomment this 73 | #packages/ 74 | 75 | # Visual C++ cache files 76 | ipch/ 77 | *.aps 78 | *.ncb 79 | *.opensdf 80 | *.sdf 81 | 82 | # Visual Studio profiler 83 | *.psess 84 | *.vsp 85 | 86 | # ReSharper is a .NET coding add-in 87 | _ReSharper* 88 | 89 | # Installshield output folder 90 | [Ee]xpress 91 | 92 | # DocProject is a documentation generator add-in 93 | DocProject/buildhelp/ 94 | DocProject/Help/*.HxT 95 | DocProject/Help/*.HxC 96 | DocProject/Help/*.hhc 97 | DocProject/Help/*.hhk 98 | DocProject/Help/*.hhp 99 | DocProject/Help/Html2 100 | DocProject/Help/html 101 | 102 | # Click-Once directory 103 | publish 104 | 105 | # Others 106 | [Bb]in 107 | [Oo]bj 108 | sql 109 | TestResults 110 | *.Cache 111 | ClientBin 112 | stylecop.* 113 | ~$* 114 | *.dbmdl 115 | Generated_Code #added for RIA/Silverlight projects 116 | 117 | # Backup & report files from converting an old project file to a newer 118 | # Visual Studio version. Backup files are not needed, because we have git ;-) 119 | _UpgradeReport_Files/ 120 | Backup*/ 121 | UpgradeLog*.XML 122 | 123 | 124 | 125 | ############ 126 | ## Windows 127 | ############ 128 | 129 | # Windows image file caches 130 | Thumbs.db 131 | 132 | # Folder config file 133 | Desktop.ini 134 | 135 | 136 | ############# 137 | ## Python 138 | ############# 139 | 140 | *.py[co] 141 | 142 | # Packages 143 | *.egg 144 | *.egg-info 145 | dist 146 | build 147 | eggs 148 | parts 149 | bin 150 | var 151 | sdist 152 | develop-eggs 153 | .installed.cfg 154 | 155 | # Installer logs 156 | pip-log.txt 157 | 158 | # Unit test / coverage reports 159 | .coverage 160 | .tox 161 | 162 | #Translations 163 | *.mo 164 | 165 | #Mr Developer 166 | .mr.developer.cfg 167 | 168 | # Mac crap 169 | .DS_Store 170 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 2 | Version 2, December 2004 3 | 4 | Copyright (C) 2004 Sam Hocevar 5 | 6 | Everyone is permitted to copy and distribute verbatim or modified 7 | copies of this license document, and changing it is allowed as long 8 | as the name is changed. 9 | 10 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 11 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 12 | 13 | 0. You just DO WHAT THE FUCK YOU WANT TO. -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 2 | Version 2, December 2004 3 | 4 | Copyright (C) 2004 Sam Hocevar 5 | 6 | Everyone is permitted to copy and distribute verbatim or modified 7 | copies of this license document, and changing it is allowed as long 8 | as the name is changed. 9 | 10 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 11 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 12 | 13 | 0. You just DO WHAT THE FUCK YOU WANT TO. 14 | 15 | 16 | - 17 | / \ 18 | / \ 19 | / MINECRAFT \ 20 | / PHP \ 21 | |\ CLIENT /| 22 | |. \ 2 / .| 23 | | .. \ / .. | 24 | | .. | .. | 25 | | .. | .. | 26 | \ | / 27 | \ | / 28 | \ | / 29 | \ | / 30 | 31 | by @shoghicp 32 | 33 | --- ENGLISH --- 34 | This Minecraft Client is a rewrite of my "Minecraft PHP Client", so it becomes modular and maintenable. 35 | It's object-oriented, and have an event system and action system to create plugins and bots easily. 36 | Supports Spoutcraft 37 | 38 | Run "php client.php --help" in console for more info 39 | Also check the "docs" folder if you want info on events and methods of the Client class 40 | 41 | 42 | --- SPANISH --- 43 | Este cliente de Minecraft ha sido reescrito desde mi anterior cliente para que sea modular y mantenible. 44 | Esta orientado a objetos, tiene un sistema de eventos y acciones para poder diseñar plugins y clientes con el 45 | facilmente. Soporta Spoutcraft 46 | 47 | Ejecuta "php client.php --help" en la consola para mas informacion 48 | tambien mira la carpeta "docs" si quieres mas informacion sobre eventos y metodos de la clase Cliente -------------------------------------------------------------------------------- /classes/AES.class.php: -------------------------------------------------------------------------------- 1 | mode = "AES-".$bits."-".strtoupper($mode).$blockSize; 51 | $this->bytes = $blockSize >> 3; 52 | $this->key = $this->encIV = $this->decIV = str_repeat("\x00", openssl_cipher_iv_length($this->mode)); 53 | $this->IVLenght = openssl_cipher_iv_length($this->mode); 54 | } 55 | 56 | public function setKey($key = ""){ 57 | $this->key = str_pad($key, $this->IVLenght, "\x00", STR_PAD_RIGHT); 58 | } 59 | 60 | public function setIV($IV = ""){ 61 | $this->encIV = $this->decIV = str_pad($IV, $this->IVLenght, "\x00", STR_PAD_RIGHT); 62 | } 63 | 64 | protected function _shiftIV(&$IV, $str){ //Only for CFB 65 | if(!isset($str{$this->IVLenght - 1})){ 66 | $len = min($this->IVLenght, strlen($str)); 67 | $IV = substr($IV, $len) . substr($str, -$len); 68 | }else{ 69 | $IV = substr($str, -$this->IVLenght); 70 | } 71 | } 72 | 73 | public function encrypt($plaintext){ 74 | $ciphertext = openssl_encrypt($plaintext, $this->mode, $this->key, true, $this->encIV); 75 | $this->_shiftIV($this->encIV, $ciphertext); 76 | return $ciphertext; 77 | } 78 | 79 | public function decrypt($ciphertext){ 80 | $plaintext = openssl_decrypt($ciphertext, $this->mode, $this->key, true, $this->decIV); 81 | $this->_shiftIV($this->decIV, $ciphertext); 82 | return $plaintext; 83 | } 84 | 85 | public function init(){ 86 | 87 | } 88 | 89 | } 90 | 91 | }else{ //mcrypt 92 | 93 | 94 | class AES{ 95 | private $key, $keyLenght, $IV, $IVLenght, $enc, $dec, $mode, $algorithm; 96 | 97 | function __construct($bits, $mode, $blockSize){ 98 | console("[DEBUG] [AES] Using Mcrypt extension", true, true, 2); 99 | $this->algorithm = "rijndael-".intval($bits); 100 | $this->mode = strtolower($mode); 101 | $mcrypt = mcrypt_module_open($this->algorithm, "", $this->mode, ""); 102 | $this->IVLenght = mcrypt_enc_get_iv_size($mcrypt); 103 | mcrypt_module_close($mcrypt); 104 | $this->keyLenght = $bits >> 3; 105 | $this->setKey(); 106 | $this->setIV(); 107 | $this->init(); 108 | } 109 | 110 | public function init(){ 111 | if(is_resource($this->enc)){ 112 | mcrypt_generic_deinit($this->enc); 113 | mcrypt_module_close($this->enc); 114 | } 115 | $this->enc = mcrypt_module_open($this->algorithm, "", $this->mode, ""); 116 | mcrypt_generic_init($this->enc, $this->key, $this->IV); 117 | 118 | if(is_resource($this->dec)){ 119 | mcrypt_generic_deinit($this->dec); 120 | mcrypt_module_close($this->dec); 121 | } 122 | $this->dec = mcrypt_module_open($this->algorithm, "", $this->mode, ""); 123 | mcrypt_generic_init($this->dec, $this->key, $this->IV); 124 | } 125 | 126 | public function setKey($key = ""){ 127 | $this->key = str_pad($key, $this->keyLenght, "\x00", STR_PAD_RIGHT); 128 | } 129 | 130 | public function setIV($IV = ""){ 131 | $this->IV = str_pad($IV, $this->IVLenght, "\x00", STR_PAD_RIGHT); 132 | } 133 | 134 | public function encrypt($plaintext){ 135 | return mcrypt_generic($this->enc, $plaintext); 136 | } 137 | 138 | public function decrypt($ciphertext){ 139 | return mdecrypt_generic($this->dec, $ciphertext); 140 | } 141 | 142 | } 143 | } -------------------------------------------------------------------------------- /classes/ASNValue.class.php: -------------------------------------------------------------------------------- 1 | Tag = $Tag; 18 | $this->Value = $Value; 19 | } 20 | 21 | function Encode() 22 | { 23 | //Write type 24 | $result = chr($this->Tag); 25 | 26 | //Write size 27 | $size = strlen($this->Value); 28 | if ($size < 127) { 29 | //Write size as is 30 | $result .= chr($size); 31 | } 32 | else { 33 | //Prepare length sequence 34 | $sizeBuf = self::IntToBin($size); 35 | 36 | //Write length sequence 37 | $firstByte = 0x80 + strlen($sizeBuf); 38 | $result .= chr($firstByte) . $sizeBuf; 39 | } 40 | 41 | //Write value 42 | $result .= $this->Value; 43 | 44 | return $result; 45 | } 46 | 47 | function Decode(&$Buffer) 48 | { 49 | //Read type 50 | $this->Tag = self::ReadByte($Buffer); 51 | 52 | //Read first byte 53 | $firstByte = self::ReadByte($Buffer); 54 | 55 | if ($firstByte < 127) { 56 | $size = $firstByte; 57 | } 58 | else if ($firstByte > 127) { 59 | $sizeLen = $firstByte - 0x80; 60 | //Read length sequence 61 | $size = self::BinToInt(self::ReadBytes($Buffer, $sizeLen)); 62 | } 63 | else { 64 | throw new Exception("Invalid ASN length value"); 65 | } 66 | 67 | $this->Value = self::ReadBytes($Buffer, $size); 68 | } 69 | 70 | protected static function ReadBytes(&$Buffer, $Length) 71 | { 72 | $result = substr($Buffer, 0, $Length); 73 | $Buffer = substr($Buffer, $Length); 74 | 75 | return $result; 76 | } 77 | 78 | protected static function ReadByte(&$Buffer) 79 | { 80 | return ord(self::ReadBytes($Buffer, 1)); 81 | } 82 | 83 | protected static function BinToInt($Bin) 84 | { 85 | $len = strlen($Bin); 86 | $result = 0; 87 | for ($i=0; $i<$len; $i++) { 88 | $curByte = self::ReadByte($Bin); 89 | $result += $curByte << (($len-$i-1)*8); 90 | } 91 | 92 | return $result; 93 | } 94 | 95 | protected static function IntToBin($Int) 96 | { 97 | $result = ''; 98 | do { 99 | $curByte = $Int % 256; 100 | $result .= chr($curByte); 101 | 102 | $Int = ($Int - $curByte) / 256; 103 | } while ($Int > 0); 104 | 105 | $result = strrev($result); 106 | 107 | return $result; 108 | } 109 | 110 | function SetIntBuffer($Value) 111 | { 112 | if (strlen($Value) > 1) { 113 | $firstByte = ord($Value{0}); 114 | if ($firstByte & 0x80) { //first bit set 115 | $Value = chr(0x00) . $Value; 116 | } 117 | } 118 | 119 | $this->Value = $Value; 120 | } 121 | 122 | function GetIntBuffer() 123 | { 124 | $result = $this->Value; 125 | if (ord($result{0}) === 0x00) { 126 | $result = substr($result, 1); 127 | } 128 | 129 | return $result; 130 | } 131 | 132 | function SetInt($Value) 133 | { 134 | $Value = self::IntToBin($Value); 135 | 136 | $this->SetIntBuffer($Value); 137 | } 138 | 139 | function GetInt() 140 | { 141 | $result = $this->GetIntBuffer(); 142 | $result = self::BinToInt($result); 143 | 144 | return $result; 145 | } 146 | 147 | function SetSequence($Values) 148 | { 149 | $result = ''; 150 | foreach ($Values as $item) { 151 | $result .= $item->Encode(); 152 | } 153 | 154 | $this->Value = $result; 155 | } 156 | 157 | function GetSequence() 158 | { 159 | $result = array(); 160 | $seq = $this->Value; 161 | while (strlen($seq)) { 162 | $val = new ASNValue(); 163 | $val->Decode($seq); 164 | $result[] = $val; 165 | } 166 | 167 | return $result; 168 | } 169 | } -------------------------------------------------------------------------------- /classes/Anvil.class.php: -------------------------------------------------------------------------------- 1 | 4096, 38 | "metaData" => 2048, 39 | "lightData" => 2048, 40 | "skyLightData" => 2048, 41 | "addData" => 2048, 42 | ); 43 | protected $column, $material, $air; 44 | var $sectionSize; 45 | 46 | function __construct(){ 47 | include("misc/materials.php"); 48 | $this->material = $material; 49 | $this->column = array(); 50 | $this->height = (int) ((string) log(HEIGHT_LIMIT, 2)); 51 | $this->air = str_repeat("\x00", 2048); 52 | $this->sectionSize = 0; 53 | foreach($this->sections as $type => $size){ 54 | if($type === "addData"){ 55 | continue; 56 | } 57 | $this->sectionSize += $size; 58 | } 59 | } 60 | 61 | protected function splitColumns($data, $bitmask, $addBitmask, $X, $Z){ 62 | $offset = 0; 63 | $len = HEIGHT_LIMIT >> 4; 64 | $lastBlock = 0; 65 | foreach($this->sections as $type => $size){ 66 | $$type = b""; 67 | for($i = 0; $i < $len; ++$i){ 68 | if (($type !== "addData" and $bitmask & (1 << $i)) or ($type === "addData" and $addBitmask & (1 << $i))){ 69 | $$type .= substr($data, $offset, $size); 70 | $offset += $size; 71 | $lastBlock = $i << 4; 72 | }elseif($type === "blockData" and isset($this->column[$X][$Z])){ 73 | $$type .= substr($this->column[$X][$Z][0], $i << 12, $size); 74 | $lastBlock = $i << 4; 75 | }elseif($type === "metaData" and isset($this->column[$X][$Z])){ 76 | $$type .= substr($this->column[$X][$Z][1], $i << 11, $size); 77 | }else{ 78 | $$type .= $size === 4096 ? $this->air . $this->air:$this->air; 79 | } 80 | } 81 | } 82 | $biomeData = substr($data, $offset, 256); 83 | 84 | if(!isset($this->column[$X])){ 85 | $this->column[$X] = array(); 86 | } 87 | $this->column[$X][$Z] = array(0 => $blockData, 1 => $metaData, 2 => $lastBlock, 3 => $biomeData); 88 | console("[DEBUG] [Anvil] Parsed X ".$X.", Z ".$Z, true, true, 2); 89 | } 90 | 91 | public function addChunk($X, $Z, $data, $bitmask, $compressed = true, $addBitmask = 0){ 92 | $X = $X << 4; 93 | $Z = $Z << 4; 94 | $this->splitColumns(($compressed === true ? gzinflate(substr($data,2)):$data), $bitmask, $addBitmask, $X, $Z); 95 | console("[INTERNAL] [Anvil] Loaded X ".$X.", Z ".$Z, true, true, 3); 96 | } 97 | 98 | //O(1) 99 | public function unloadChunk($X, $Z){ 100 | $X = $X << 4; 101 | $Z = $Z << 4; 102 | unset($this->column[$X][$Z]); 103 | console("[DEBUG] [Anvil] Unloaded X ".$X." Z ".$Z, true, true, 2); 104 | } 105 | 106 | 107 | //O(1) 108 | public function getIndex($x, $y, $z){ 109 | $X = ($x >> 4) << 4; //Round to the next 16 multiple 110 | $Z = ($z >> 4) << 4; 111 | $index = ($y << $this->height) + (($z - $Z) << 4) + ($x - $X); 112 | return array($X, $Z, $index); 113 | } 114 | 115 | public function getColumn($x, $z, $meta = true){ 116 | $index = $this->getIndex($x, 0, $z); 117 | if(!isset($this->column[$index[0]][$index[1]])){ 118 | return array_fill(0, HEIGHT_LIMIT, array(0, 0)); 119 | } 120 | $block = preg_replace("/(.).{".(HEIGHT_LIMIT - 1)."}/s", '$1', substr($this->column[$index[0]][$index[1]][0], $index[2], HEIGHT_LIMIT << $this->height)); 121 | if($meta === true){ 122 | $meta = preg_replace("/(.).{".(HEIGHT_LIMIT >> 1 - 1)."}/s", '$1', substr($this->column[$index[0]][$index[1]][0], $index[2], HEIGHT_LIMIT << ($this->height - 1))); 123 | } 124 | $data = array(); 125 | $m = 0; 126 | for($i = 0; $i < HEIGHT_LIMIT; ++$i){ 127 | $b = ord($block{$i}); 128 | if($meta === true){ 129 | $m = ord($this->column[$index[0]][$index[1]][1]{$index[2] >> 1}); 130 | if($y % 2 === 0){ 131 | $m = $m & 0x0F; 132 | }else{ 133 | $m = $m >> 4; 134 | } 135 | } 136 | $data[$i] = array($b, $m); 137 | } 138 | return $data; 139 | } 140 | 141 | public function getFloor($x, $z, $startY = -1){ //Fast method 142 | $index = $this->getIndex($x, HEIGHT_LIMIT, $z); 143 | if(!isset($this->column[$index[0]][$index[1]])){ 144 | return array(0, 0, 0); 145 | } 146 | if(((int) $startY) > -1){ 147 | $i = ((int) $startY >> 4) << 4; 148 | }else{ 149 | $i = $this->column[$index[0]][$index[1]][2] + 16; 150 | } 151 | $index[2] -= (HEIGHT_LIMIT - $i) << $this->height; 152 | $b =& $this->column[$index[0]][$index[1]][0]; 153 | 154 | for($y = $i; $y > 0; --$y){ 155 | if(!isset($this->material["nosolid"][ord($b{$index[2]})])){ 156 | break; 157 | } 158 | $index[2] -= HEIGHT_LIMIT; 159 | } 160 | 161 | $block = $this->getBlock($x, $y, $z, $index); 162 | return array($y, $block[0], $block[1]); 163 | } 164 | 165 | public function getBlock($x, $y, $z, $index = false){ 166 | if($index === false){ 167 | $index = $this->getIndex($x, $y, $z); 168 | } 169 | if(isset($this->column[$index[0]][$index[1]])){ 170 | $block = ord($this->column[$index[0]][$index[1]][0]{$index[2]}); 171 | $meta = ord($this->column[$index[0]][$index[1]][1]{$index[2] >> 1}); 172 | if($index[2] % 2 === 0){ 173 | $meta = $meta & 0x0F; 174 | }else{ 175 | $meta = $meta >> 4; 176 | } 177 | return array($block, $meta); 178 | } 179 | return array(0, 0); 180 | } 181 | 182 | public function getBiome($x, $z){ 183 | $index = $this->getIndex($x, 0, $z); 184 | return ord($this->column[$index[0]][$index[1]][3]{(($z - $index[1]) << 4) + ($x - $index[0])}); 185 | } 186 | 187 | public function changeBlock($x, $y, $z, $block, $meta = 0){ 188 | console("[INTERNAL] [Anvil] Changed block X ".$x." Y ".$y." Z ".$z, true, true, 3); 189 | $index = $this->getIndex($x, $y, $z); 190 | if(isset($this->column[$index[0]][$index[1]][0]{$index[2]})){ 191 | $this->column[$index[0]][$index[1]][0]{$index[2]} = chr($block); 192 | if($index[2] % 2 === 0){ 193 | $this->column[$index[0]][$index[1]][1]{$index[2] >> 1} = chr((ord($this->column[$index[0]][$index[1]][1]{$index[2] >> 1}) & 0xF0) | ($meta & 0x0F)); 194 | }else{ 195 | $this->column[$index[0]][$index[1]][1]{$index[2] >> 1} = chr((ord($this->column[$index[0]][$index[1]][1]{$index[2] >> 1}) & 0x0F) | ($meta >> 4)); 196 | } 197 | } 198 | } 199 | } -------------------------------------------------------------------------------- /classes/MapInterface.class.php: -------------------------------------------------------------------------------- 1 | client = $client; 40 | $this->map = $this->client->mapParser; 41 | $this->floor = method_exists($this->map, "getFloor"); 42 | $this->column = method_exists($this->map, "getColumn"); 43 | $this->biome = method_exists($this->map, "getBiome"); 44 | include("misc/materials.php"); 45 | $this->material = $material; 46 | include("misc/biomes.php"); 47 | $this->biomes = $biomes; 48 | } 49 | 50 | public function getBiome($x, $z){ 51 | $x = (int) $x; 52 | $z = (int) $z; 53 | if($this->biome === true){ 54 | return $this->map->getBiome($x, $z); 55 | }else{ 56 | return 0; 57 | } 58 | } 59 | 60 | public function getBiomeName($x, $z){ 61 | $biome = $this->getBiome($x, $z); 62 | return isset($this->biomes[$biome]) ? $this->biomes[$biome]:"Unknown"; 63 | } 64 | 65 | public function getBlockName($x, $y, $z){ 66 | $block = $this->getBlock($x, $y, $z); 67 | return isset($this->material[$block[0]]) ? $this->material[$block[0]]:"Unknown"; 68 | } 69 | 70 | public function getFloor($x, $z, $startY = -1){ 71 | $x = (int) $x; 72 | $z = (int) $z; 73 | $this->client->toggleEvent("onTick"); 74 | if($this->floor === true){ 75 | $map = $this->map->getFloor($x, $z, $startY); 76 | $this->client->toggleEvent("onTick"); 77 | return $map; 78 | }else{ 79 | $startY = ((int) $startY) > -1 ? ((int) $startY):HEIGHT_LIMIT - 1; 80 | for($y = $startY; $y > 0; --$y){ 81 | $block = $this->getBlock($x, $y, $z); 82 | if(!isset($this->material["nosolid"][$block[0]])){ 83 | break; 84 | } 85 | } 86 | $this->client->toggleEvent("onTick"); 87 | return array($y, $block[0], $block[1]); 88 | } 89 | } 90 | 91 | public function changeBlock($x, $y, $z, $block, $metadata = 0){ 92 | $x = (int) $x; 93 | $y = (int) $y; 94 | $z = (int) $z; 95 | return $this->map->changeBlock($x, $y, $z, $block, $metadata); 96 | } 97 | 98 | public function getBlock($x, $y, $z){ 99 | $x = (int) $x; 100 | $y = (int) $y; 101 | $z = (int) $z; 102 | return $this->map->getBlock($x, $y, $z); 103 | } 104 | 105 | public function getColumn($x, $z){ 106 | $x = (int) $x; 107 | $z = (int) $z; 108 | if($this->column === true){ 109 | return $this->map->getColumn($x, $z); 110 | }else{ 111 | $zone = $this->getZone($x,0,$z,$x,HEIGHT_LIMIT,$z); 112 | $data = array(); 113 | foreach($zone as $x => $a){ 114 | foreach($a as $y => $b){ 115 | foreach($b as $z => $block){ 116 | $data[$y] = $block; 117 | } 118 | } 119 | } 120 | return $data; 121 | } 122 | } 123 | 124 | public function getEllipse($x, $y, $z, $rX = 4, $rZ = 4, $rY = 4){ 125 | $x = (int) $x; 126 | $y = (int) $y; 127 | $z = (int) $z; 128 | $rY = abs((int) $rX); 129 | $rY = abs((int) $rZ); 130 | $rY = abs((int) $rY); 131 | return $this->getZone($x-$rX,max(0,$y-$rY),$z-$rZ,$x+$rX,$y+$rY,$z+$rZ); 132 | } 133 | 134 | public function getSphere($x, $y, $z, $r=4){ 135 | $x = (int) $x; 136 | $y = (int) $y; 137 | $z = (int) $z; 138 | $r = abs((int) $r); 139 | return $this->getZone($x-$r,max(0,$y-$r),$z-$r,$x+$r,$y+$r,$z+$r); 140 | } 141 | 142 | public function getZone($x1, $y1, $z1, $x2, $y2, $z2){ 143 | $x1 = (int) $x1; 144 | $y1 = (int) $y1; 145 | $z1 = (int) $z1; 146 | $x2 = (int) $x2; 147 | $y2 = (int) $y2; 148 | $z2 = (int) $z2; 149 | if($x1>$x2 or $y1>$y2 or $z1>$z2){ 150 | return array(); 151 | } 152 | $this->client->toggleEvent("onTick"); 153 | $blocks = array(); 154 | for($x=$x1;$x<=$x2;++$x){ 155 | $blocks[$x] = array(); 156 | for($z=$z1;$z<=$z2;++$z){ 157 | $blocks[$x][$z] = array(); 158 | for($y=$y1;$y<=$y2;++$y){ 159 | $blocks[$x][$z][$y] = $this->getBlock($x,$y,$z); 160 | } 161 | } 162 | } 163 | $this->client->toggleEvent("onTick"); 164 | return $blocks; 165 | } 166 | 167 | } -------------------------------------------------------------------------------- /classes/McRegion.class.php: -------------------------------------------------------------------------------- 1 | block = array(); 39 | } 40 | 41 | protected function splitColumns($data, $X, $Z){ 42 | 43 | $chunkBlocks = 16 * 16 * 128; //32768 44 | for($offset=0;$offset<$chunkBlocks;++$offset){ 45 | $x = $X + ($offset >> 11); 46 | $y = $offset & 0x7F; 47 | $z = $Z + (($offset & 0x780) >> 7 ); 48 | $block = ord($data{$totalOffset+$offset}); 49 | if(!isset($this->block[$x])){ 50 | $this->block[$x] = array(); 51 | } 52 | if(!isset($this->block[$x][$z])){ 53 | $this->block[$x][$z] = array(); 54 | } 55 | if(!isset($this->block[$x1][$z1][$y1])){ 56 | $this->block[$x][$z][$y] = array($block, 0); 57 | }else{ 58 | $this->block[$x][$z][$y][0] = $block; 59 | } 60 | } 61 | $totalOffset += $offset; 62 | for($offset=0;$offset<$chunkBlocks;$offset += 2){ 63 | $byte = ord($data{$totalOffset+($offset/2)}); 64 | $x = $X + (($offset) >> 11); 65 | $y = ($offset) & 0x7F; 66 | $z = $Z + ((($offset) & 0x780) >> 7 ); 67 | $block = $byte & 0x0F; 68 | if(!isset($this->block[$x])){ 69 | $this->block[$x] = array(); 70 | } 71 | if(!isset($this->block[$x][$z])){ 72 | $this->block[$x][$z] = array(); 73 | } 74 | if(!isset($this->block[$x][$z][$y])){ 75 | $this->block[$x][$z][$y] = array(0, $block); 76 | }else{ 77 | $this->block[$x][$z][$y][1] = $block; 78 | } 79 | 80 | $x = $X + (($offset+1) >> 11); 81 | $y = ($offset+1) & 0x7F; 82 | $z = $Z + ((($offset+1) & 0x780) >> 7 ); 83 | $block = ($byte >> 4) & 0x0F; 84 | if(!isset($this->block[$x])){ 85 | $this->block[$x] = array(); 86 | } 87 | if(!isset($this->block[$x][$z])){ 88 | $this->block[$x][$z] = array(); 89 | } 90 | if(!isset($this->block[$x][$z][$y])){ 91 | $this->block[$x][$z][$y] = array(0, $block); 92 | }else{ 93 | $this->block[$x][$z][$y][1] = $block; 94 | } 95 | 96 | } 97 | console("[DEBUG] [McRegion] Parsed X ".$X.", Z ".$Z, true, true, 2); 98 | } 99 | 100 | public function addChunk($X, $Z, $data, $compressed = true){ 101 | $X *= 16; 102 | $Z *= 16; 103 | 104 | if(!isset($this->block[$X][$Z])){ 105 | if(!isset($this->raw[$X])){ 106 | $this->raw[$X] = array(); 107 | } 108 | if(!isset($this->raw[$X][$Z])){ 109 | $this->raw[$X][$Z] = array(); 110 | } 111 | $this->raw[$X][$Z][] = array(($compressed === true ? gzinflate(substr($data,2)):$data), $X, $Z); 112 | }else{ 113 | $this->splitColumns(($compressed === true ? gzinflate(substr($data,2)):$data), $X, $Z); 114 | } 115 | console("[INTERNAL] [McRegion] Loaded X ".$X.", Z ".$Z, true, true, 3); 116 | } 117 | 118 | protected function checkChunk($X, $Z){ 119 | $X = floor($X / 16) * 16; 120 | $Z = floor($Z / 16) * 16; 121 | 122 | if(isset($this->raw[$X][$Z])){ 123 | foreach($this->raw[$X][$Z] as $d){ 124 | $this->splitColumns($d[0], $d[2], $d[3]); 125 | } 126 | unset($this->raw[$X][$Z]); 127 | return true; 128 | }elseif(isset($this->block[$X][$Z])){ 129 | return true; 130 | } 131 | return false; 132 | } 133 | 134 | public function unloadChunk($X, $Z){ 135 | $X = floor($X / 16) * 16; 136 | $Z = floor($Z / 16) * 16; 137 | for($x = $X; $x < ($X + 16); ++$x){ 138 | for($z = $Z; $z < ($Z + 16); ++$z){ 139 | unset($this->block[$x][$z]); 140 | unset($this->raw[$x][$z]); 141 | } 142 | } 143 | console("[DEBUG] [McRegion] Unloaded X ".$X." Z ".$Z, true, true, 2); 144 | } 145 | 146 | public function getBlock($x, $y, $z){ 147 | $this->checkChunk($x, $z); 148 | if(!isset($this->block[$x][$z][$y])){ 149 | return array(0, 0); 150 | } 151 | return $this->block[$x][$z][$y]; 152 | } 153 | 154 | public function changeBlock($x, $y, $z, $block, $metadata = 0){ 155 | console("[INTERNAL] [McRegion] Changed block X ".$x." Y ".$y." Z ".$z, true, true, 3); 156 | if(!isset($this->block[$x])){ 157 | $this->block[$x] = array(); 158 | } 159 | if(!isset($this->block[$x][$z])){ 160 | $this->block[$x][$z] = array(); 161 | } 162 | $this->block[$x][$z][$y] = array($block, $metadata); 163 | } 164 | } -------------------------------------------------------------------------------- /classes/MinecraftInterface.class.php: -------------------------------------------------------------------------------- 1 | server = new Socket($server, $port, (bool) $listen); 39 | $this->protocol = (int) $protocol; 40 | require("pstruct/".$this->protocol.".php"); 41 | require("pstruct/packetName.php"); 42 | $this->pstruct = $pstruct; 43 | $this->name = $packetName; 44 | } 45 | 46 | public function close(){ 47 | return $this->server->close(); 48 | } 49 | 50 | protected function getStruct($pid){ 51 | if(isset($this->pstruct[$pid])){ 52 | return $this->pstruct[$pid]; 53 | } 54 | return false; 55 | } 56 | 57 | protected function writeDump($pid, $raw, $data, $origin = "client"){ 58 | if(LOG === true and DEBUG >= 2){ 59 | $p = "[".microtime(true)."] [".($origin === "client" ? "CLIENT->SERVER":"SERVER->CLIENT")."]: ".$this->name[$pid]." (0x".Utils::strToHex(chr($pid)).") [lenght ".strlen($raw)."]".PHP_EOL; 60 | $p .= Utils::hexdump($raw); 61 | if(is_array($data)){ 62 | foreach($data as $i => $d){ 63 | $p .= $i ." => ".(!is_array($d) ? $this->pstruct[$pid][$i]."(".(($this->pstruct[$pid][$i] === "byteArray" or $this->pstruct[$pid][$i] === "newChunkArray" or $this->pstruct[$pid][$i] === "chunkArray" or $this->pstruct[$pid][$i] === "chunkInfo" or $this->pstruct[$pid][$i] === "multiblockArray" or $this->pstruct[$pid][$i] === "newMultiblockArray") ? Utils::strToHex($d):$d).")":$this->pstruct[$pid][$i]."(***)").PHP_EOL; 64 | } 65 | } 66 | $p .= PHP_EOL; 67 | logg($p, "packets", false); 68 | } 69 | 70 | } 71 | 72 | public function readPacket($mode = false){ 73 | if($this->server->connected === false){ 74 | return array("pid" => 0xff, "data" => array(0 => "Connection error", 1 => true)); 75 | } 76 | $pid = $this->server->read(1, $mode); 77 | if($pid == ""){ 78 | return false; 79 | } 80 | $pid = ord($pid); 81 | $struct = $this->getStruct($pid); 82 | if($struct === false){ 83 | $this->server->unblock(); 84 | $p = "[".microtime(true)."] [SERVER->CLIENT]: Error, bad packet id 0x".Utils::strToHex(chr($pid)).PHP_EOL; 85 | $p .= Utils::hexdump(chr($pid).$this->server->read(1024, true)); 86 | $p .= PHP_EOL . "--------------- (1024 byte max extract) ----------" .PHP_EOL; 87 | logg($p, "packets", true, 3); 88 | 89 | $this->buffer = ""; 90 | $this->server->receive("\xff".Utils::writeString("Bad packet id 0x".Utils::strToHex(chr($pid)))); 91 | $this->writePacket(0xff, array(0 => "Bad packet id 0x".Utils::strToHex(chr($pid)))); 92 | return array("pid" => 0xff, "data" => array(0 => "Bad packet id 0x".Utils::strToHex(chr($pid)))); 93 | } 94 | 95 | $packet = new Packet($pid, $struct, $this->server); 96 | $packet->protocol = $this->protocol; 97 | $packet->parse(); 98 | 99 | $this->writeDump($pid, $packet->raw, $packet->data, "server"); 100 | return array("pid" => $pid, "data" => $packet->data, "raw" => $packet->raw); 101 | } 102 | 103 | public function writePacket($pid, $data = array(), $raw = false){ 104 | $struct = $this->getStruct($pid); 105 | if(($pid === 0x01 or $pid === 0x09) and $this->protocol >= 32){ 106 | $struct = array(); 107 | } 108 | if($raw === false){ 109 | $packet = new Packet($pid, $struct); 110 | $packet->protocol = $this->protocol; 111 | $packet->data = $data; 112 | $packet->create(); 113 | $write = $this->server->write($packet->raw); 114 | $this->writeDump($pid, $packet->raw, $data, "client"); 115 | }else{ 116 | $write = $this->server->write($data); 117 | $this->writeDump($pid, $data, false, "client"); 118 | } 119 | return true; 120 | } 121 | 122 | } 123 | 124 | ?> -------------------------------------------------------------------------------- /classes/Path.class.php: -------------------------------------------------------------------------------- 1 | path = array(); 39 | } 40 | 41 | public function get($i){ 42 | $j = 0; 43 | foreach($this->path as $value){ 44 | if($j === $i){ 45 | return $value; 46 | } 47 | ++$j; 48 | } 49 | return null; 50 | } 51 | 52 | public function add($pos){ 53 | $x = (int) $pos["x"]; 54 | $y = (int) $pos["y"]; 55 | $z = (int) $pos["z"]; 56 | $this->path[$x.".".$z.".".$y] = $pos; 57 | } 58 | 59 | public function remove($pos){ 60 | $x = (int) $pos["x"]; 61 | $y = (int) $pos["y"]; 62 | $z = (int) $pos["z"]; 63 | unset($this->path[$x.".".$z.".".$y]); 64 | } 65 | 66 | public function contains($pos){ 67 | $x = (int) $pos["x"]; 68 | $y = (int) $pos["y"]; 69 | $z = (int) $pos["z"]; 70 | return isset($this->path[$x.".".$z.".".$y]); 71 | } 72 | 73 | public function size(){ 74 | return count($this->path); 75 | } 76 | 77 | public function reverse(){ 78 | array_reverse($this->path); 79 | } 80 | 81 | public function toArray(){ 82 | return $this->path; 83 | } 84 | 85 | } -------------------------------------------------------------------------------- /classes/Socket.class.php: -------------------------------------------------------------------------------- 1 | errors = array_fill(88,(125 - 88) + 1, true); 42 | if($socket !== false){ 43 | $this->sock = $socket; 44 | $this->setTimeout((int) $timeout); 45 | $this->connected = true; 46 | $this->buffer = ""; 47 | $this->unblock(); 48 | $this->encryption = false; 49 | socket_set_option($this->sock, SOL_SOCKET, SO_KEEPALIVE, 1); 50 | }else{ 51 | if($listen !== true){ 52 | $this->sock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); 53 | $this->setTimeout((int) $timeout); 54 | if(@socket_connect($this->sock, $server, $port) === false){ 55 | $this->connected = false; 56 | }else{ 57 | $this->connected = true; 58 | $this->buffer = ""; 59 | $this->block(); 60 | $this->encryption = false; 61 | socket_set_option($this->sock, SOL_SOCKET, SO_KEEPALIVE, 1); 62 | } 63 | }else{ 64 | $this->sock = socket_create_listen($port); 65 | $this->unblock(); 66 | } 67 | } 68 | } 69 | 70 | public function setTimeout($sec, $usec = 0){ 71 | socket_set_option($this->sock, SOL_SOCKET, SO_RCVTIMEO, array( 72 | "sec" => $sec, 73 | "usec" => $usec 74 | )); 75 | socket_set_option($this->sock, SOL_SOCKET, SO_SNDTIMEO, array( 76 | "sec" => $sec, 77 | "usec" => $usec 78 | )); 79 | } 80 | 81 | function listenSocket(){ 82 | $sock = @socket_accept($this->sock); 83 | if($sock !== false){ 84 | $sock = new Socket(false, false, false, $sock); 85 | $sock->unblock(); 86 | return $sock; 87 | } 88 | return false; 89 | } 90 | 91 | function startAES($key){ 92 | console("[DEBUG] [Socket] Secure channel with AES-".(strlen($key) >> 3)."-CFB8 encryption established", true, true, 2); 93 | require_once(dirname(__FILE__)."/AES.class.php"); 94 | $this->encrypt = new AES(128, "CFB", 8); 95 | $this->encrypt->setKey($key); 96 | $this->encrypt->setIV($key); 97 | $this->encrypt->init(); 98 | $this->decrypt =& $this->encrypt; 99 | $this->encryption = true; 100 | } 101 | 102 | function startRC4($key){ 103 | console("[DEBUG] [Socket] Activating RC4-".(strlen($key) >> 3)." encryption", true, true, 2); 104 | require_once("phpseclib/Crypt/RC4.php"); 105 | $this->encrypt = new Crypt_RC4(); 106 | $this->encrypt->setKey($key); 107 | $this->encrypt->enableContinuousBuffer(); 108 | $this->decrypt = new Crypt_RC4(); 109 | $this->decrypt->setKey($key); 110 | $this->decrypt->enableContinuousBuffer(); 111 | $this->encryption = true; 112 | } 113 | 114 | public function close($error = 125){ 115 | $this->connected = false; 116 | if($error === false){ 117 | console("[ERROR] [Socket] Socket closed, Error: End of Stream"); 118 | }else{ 119 | console("[ERROR] [Socket] Socket closed, Error $error: ".socket_strerror($error)); 120 | } 121 | return @socket_close($this->sock); 122 | } 123 | 124 | public function block(){ 125 | socket_set_block($this->sock); 126 | } 127 | 128 | public function unblock(){ 129 | socket_set_nonblock($this->sock); 130 | } 131 | 132 | public function read($len, $unblock = false){ 133 | if($len <= 0){ 134 | return ""; 135 | }elseif($this->connected === false){ 136 | return str_repeat("\x00", $len); 137 | } 138 | while(!isset($this->buffer{$len-1}) and $this->connected === true){ 139 | $this->get($len); 140 | if($unblock === true){ 141 | break; 142 | } 143 | } 144 | if(!isset($this->buffer{$len-1})){ 145 | return ""; 146 | } 147 | 148 | if($len === 1){ 149 | $ret = $this->buffer{0}; 150 | }else{ 151 | $ret = substr($this->buffer, 0, $len); 152 | } 153 | 154 | $this->buffer = substr($this->buffer, $len); 155 | return $ret; 156 | 157 | } 158 | 159 | public function receive($str){ //Auto write a packet 160 | if($str != ""){ 161 | $this->buffer .= $this->encryption === true ? $this->decrypt->decrypt($str):$str; 162 | } 163 | } 164 | 165 | public function write($str){ 166 | if($str != ""){ 167 | return @socket_write($this->sock, ($this->encryption === true ? $this->encrypt->encrypt($str):$str)); 168 | } 169 | } 170 | 171 | function get($len){ 172 | if(!isset($this->buffer{$len}) and $this->connected === true){ 173 | $read = @socket_read($this->sock, $len, PHP_BINARY_READ); 174 | if($read !== "" and $read !== false){ 175 | $this->receive($read); 176 | }elseif($read === false and isset($this->errors[socket_last_error($this->sock)])){ 177 | $this->close(socket_last_error($this->sock)); 178 | }elseif($read === ""){ 179 | $this->close(false); 180 | }else{ 181 | usleep(50000); 182 | } 183 | } 184 | } 185 | } 186 | 187 | ?> -------------------------------------------------------------------------------- /classes/Window.class.php: -------------------------------------------------------------------------------- 1 | id = (int) $id; 49 | $this->type = (int) $type; 50 | $this->title = (string) $title; 51 | $this->slots = array(); 52 | $this->zones = array(); 53 | switch($this->type){ 54 | case WINDOW_INVENTORY: 55 | $this->zones["output"] = 0; 56 | $this->zones["craft"] = range(1, 4); 57 | $this->zones["armor"] = range(5, 8); 58 | $this->zones["inventory"] = range(9, 35); 59 | $this->zones["held"] = range(36, 44); 60 | break; 61 | case WINDOW_WORKBENCH: 62 | $this->zones["output"] = 0; 63 | $this->zones["craft"] = range(1, 9); 64 | $this->zones["inventory"] = range(10, 36); 65 | $this->zones["held"] = range(37, 45); 66 | break; 67 | case WINDOW_CHEST: 68 | break; 69 | case WINDOW_FURNACE: 70 | $this->zones["output"] = 2; 71 | $this->zones["fuel"] = 1; 72 | $this->zones["input"] = 0; 73 | $this->zones["inventory"] = range(3, 29); 74 | $this->zones["held"] = range(30, 38); 75 | break; 76 | case WINDOW_DISPENSER: 77 | $this->zones["input"] = range(0, 8); 78 | $this->zones["inventory"] = range(9, 35); 79 | $this->zones["held"] = range(36, 44); 80 | break; 81 | case WINDOW_ENCHANTMENT_TABLE: 82 | $this->zones["input"] = 0; 83 | $this->zones["output"] = 0; 84 | $this->zones["inventory"] = range(1, 27); 85 | $this->zones["held"] = range(28, 36); 86 | break; 87 | case WINDOW_BREWING: 88 | 89 | break; 90 | 91 | } 92 | 93 | } 94 | } 95 | 96 | ?> -------------------------------------------------------------------------------- /classes/phpseclib/Crypt/RSA.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shoghicp/Minecraft-PHP-Client-2/59e99cf54444198da69c90fcaded0e7c12f035a8/classes/phpseclib/Crypt/RSA.php -------------------------------------------------------------------------------- /classes/phpseclib/Crypt/Random.php: -------------------------------------------------------------------------------- 1 | 11 | * 16 | * 17 | * 18 | * LICENSE: Permission is hereby granted, free of charge, to any person obtaining a copy 19 | * of this software and associated documentation files (the "Software"), to deal 20 | * in the Software without restriction, including without limitation the rights 21 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 22 | * copies of the Software, and to permit persons to whom the Software is 23 | * furnished to do so, subject to the following conditions: 24 | * 25 | * The above copyright notice and this permission notice shall be included in 26 | * all copies or substantial portions of the Software. 27 | * 28 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 31 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 32 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 33 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 34 | * THE SOFTWARE. 35 | * 36 | * @category Crypt 37 | * @package Crypt_Random 38 | * @author Jim Wigginton 39 | * @copyright MMVII Jim Wigginton 40 | * @license http://www.opensource.org/licenses/mit-license.html MIT License 41 | * @version $Id: Random.php,v 1.9 2010/04/24 06:40:48 terrafrost Exp $ 42 | * @link http://phpseclib.sourceforge.net 43 | */ 44 | 45 | /** 46 | * Generate a random value. 47 | * 48 | * On 32-bit machines, the largest distance that can exist between $min and $max is 2**31. 49 | * If $min and $max are farther apart than that then the last ($max - range) numbers. 50 | * 51 | * Depending on how this is being used, it may be worth while to write a replacement. For example, 52 | * a PHP-based web app that stores its data in an SQL database can collect more entropy than this function 53 | * can. 54 | * 55 | * @param optional Integer $min 56 | * @param optional Integer $max 57 | * @return Integer 58 | * @access public 59 | */ 60 | function crypt_random($min = 0, $max = 0x7FFFFFFF) 61 | { 62 | if ($min == $max) { 63 | return $min; 64 | } 65 | 66 | if (function_exists('openssl_random_pseudo_bytes')) { 67 | // openssl_random_pseudo_bytes() is slow on windows per the following: 68 | // http://stackoverflow.com/questions/1940168/openssl-random-pseudo-bytes-is-slow-php 69 | if ((PHP_OS & "\xDF\xDF\xDF") !== 'WIN') { // PHP_OS & "\xDF\xDF\xDF" == strtoupper(substr(PHP_OS, 0, 3)), but a lot faster 70 | extract(unpack('Nrandom', openssl_random_pseudo_bytes(4))); 71 | 72 | return abs($random) % ($max - $min) + $min; 73 | } 74 | } 75 | 76 | // see http://en.wikipedia.org/wiki//dev/random 77 | static $urandom = true; 78 | if ($urandom === true) { 79 | // Warning's will be output unles the error suppression operator is used. Errors such as 80 | // "open_basedir restriction in effect", "Permission denied", "No such file or directory", etc. 81 | $urandom = @fopen('/dev/urandom', 'rb'); 82 | } 83 | if (!is_bool($urandom)) { 84 | extract(unpack('Nrandom', fread($urandom, 4))); 85 | 86 | // say $min = 0 and $max = 3. if we didn't do abs() then we could have stuff like this: 87 | // -4 % 3 + 0 = -1, even though -1 < $min 88 | return abs($random) % ($max - $min) + $min; 89 | } 90 | 91 | /* Prior to PHP 4.2.0, mt_srand() had to be called before mt_rand() could be called. 92 | Prior to PHP 5.2.6, mt_rand()'s automatic seeding was subpar, as elaborated here: 93 | 94 | http://www.suspekt.org/2008/08/17/mt_srand-and-not-so-random-numbers/ 95 | 96 | The seeding routine is pretty much ripped from PHP's own internal GENERATE_SEED() macro: 97 | 98 | http://svn.php.net/viewvc/php/php-src/tags/php_5_3_2/ext/standard/php_rand.h?view=markup */ 99 | if (version_compare(PHP_VERSION, '5.2.5', '<=')) { 100 | static $seeded; 101 | if (!isset($seeded)) { 102 | $seeded = true; 103 | mt_srand(fmod(time() * getmypid(), 0x7FFFFFFF) ^ fmod(1000000 * lcg_value(), 0x7FFFFFFF)); 104 | } 105 | } 106 | 107 | static $crypto; 108 | 109 | // The CSPRNG's Yarrow and Fortuna periodically reseed. This function can be reseeded by hitting F5 110 | // in the browser and reloading the page. 111 | 112 | if (!isset($crypto)) { 113 | $key = $iv = ''; 114 | for ($i = 0; $i < 8; $i++) { 115 | $key.= pack('n', mt_rand(0, 0xFFFF)); 116 | $iv .= pack('n', mt_rand(0, 0xFFFF)); 117 | } 118 | switch (true) { 119 | case class_exists('Crypt_AES'): 120 | $crypto = new Crypt_AES(CRYPT_AES_MODE_CTR); 121 | break; 122 | case class_exists('Crypt_TripleDES'): 123 | $crypto = new Crypt_TripleDES(CRYPT_DES_MODE_CTR); 124 | break; 125 | case class_exists('Crypt_DES'): 126 | $crypto = new Crypt_DES(CRYPT_DES_MODE_CTR); 127 | break; 128 | case class_exists('Crypt_RC4'): 129 | $crypto = new Crypt_RC4(); 130 | break; 131 | default: 132 | extract(unpack('Nrandom', pack('H*', sha1(mt_rand(0, 0x7FFFFFFF))))); 133 | return abs($random) % ($max - $min) + $min; 134 | } 135 | $crypto->setKey($key); 136 | $crypto->setIV($iv); 137 | $crypto->enableContinuousBuffer(); 138 | } 139 | 140 | extract(unpack('Nrandom', $crypto->encrypt("\0\0\0\0"))); 141 | return abs($random) % ($max - $min) + $min; 142 | } 143 | -------------------------------------------------------------------------------- /classes/phpseclib/File/ASN1.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shoghicp/Minecraft-PHP-Client-2/59e99cf54444198da69c90fcaded0e7c12f035a8/classes/phpseclib/File/ASN1.php -------------------------------------------------------------------------------- /classes/phpseclib/Math/BigInteger.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shoghicp/Minecraft-PHP-Client-2/59e99cf54444198da69c90fcaded0e7c12f035a8/classes/phpseclib/Math/BigInteger.php -------------------------------------------------------------------------------- /classes/phpseclib/openssl.cnf: -------------------------------------------------------------------------------- 1 | # minimalist openssl.cnf file for use with phpseclib 2 | 3 | HOME = . 4 | RANDFILE = $ENV::HOME/.rnd 5 | 6 | [ v3_ca ] -------------------------------------------------------------------------------- /config.php: -------------------------------------------------------------------------------- 1 | Fired when the packet PID is going to be sent 39 | recieved_[PID] pdata => Triggered when recieved the packet PID 40 | onRecievedPacket array(pid => PID, data => pdata) 41 | onSentPacket array(pid => PID, data => pdata) 42 | onClose message => Just before closing the client 43 | onChat message 44 | onChatSent message 45 | onTimeChange time 46 | onTimeStateChange state 47 | onDay null 48 | onNight null 49 | onSpawnChange array coords 50 | onHealthChange array(health => health, food => food) 51 | onDeath null 52 | onRespawn array data 53 | onMove object Entity 54 | onPlayerSpawn object Entity 55 | onEntitySpawn object Entity 56 | onEntityMove object Entity 57 | onEntityMove_[EID] object Entity 58 | onEntityDespawn EID 59 | onRainStart time 60 | onRainStop time 61 | onGamemodeChange gamemode 62 | onThunderbolt array(eid => eid, coords => coords) 63 | onInventorySlotChanged array(slot => slot, data => sdata) 64 | onInventoryChanged array inventory 65 | onConnect null 66 | onUseEntity array(eid => eid, left => left) 67 | onDropSlot null 68 | onPluginMessage array(channel => channel, data => data) 69 | onPluginMessage_[CHANNEL] data => data 70 | onPluginChannelRegister channel 71 | onPluginChannelRegister_[CHANNEL] null 72 | onPluginChannelUnregister channel 73 | onPluginChannelUnegister_[CHANNEL] null 74 | onRecievedSpoutPacket_[PID] array(version => version, data => data) 75 | onRecievedSpoutPacket array(pid => PID, version => version, data => data) 76 | onSentSpoutPacket_[PID] array(version => version, data => data) 77 | onSentSpoutPacket array(pid => PID, version => version, data => data) 78 | onSpoutBlock array(id => BID, data => data, name => name) 79 | onSpoutBlock_[BID] array(data => data, name => name) 80 | onSpoutPlugins array plugins 81 | onSpoutPreCacheCompleted null 82 | onSpoutPermissions array permissions 83 | onSpoutClipboard text 84 | onSpoutWaypoint array(coords => array coords, name => name, death => death) 85 | onSignUpdate array(coords => array coords, text => text) 86 | onEntityAction_[ID] object Entity 87 | onTick time 88 | onPlayerPing array(name => name, ping => ping) 89 | onPlayerPingRemove name 90 | onEntityMetadataChange object Entity 91 | onEntityMetadataChange_[EID] object Entity 92 | 93 | 94 | Special events: 95 | 96 | onChatHandler array info => Fired by plugin ChatHandler 97 | onChatCommand_[COMMAND] array parameters => Fired by plugin ChatCommand 98 | onLagStart null => Fired by plugin LagOMeter 99 | onLagEnd time => Fired by plugin LagOMeter -------------------------------------------------------------------------------- /docs/methods.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | - 5 | / \ 6 | / \ 7 | / MINECRAFT \ 8 | / PHP \ 9 | |\ CLIENT /| 10 | |. \ 2 / .| 11 | | .. \ / .. | 12 | | .. | .. | 13 | | .. | .. | 14 | \ | / 15 | \ | / 16 | \ | / 17 | \ | / 18 | 19 | 20 | by @shoghicp 21 | 22 | 23 | 24 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 25 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 26 | 27 | 0. You just DO WHAT THE FUCK YOU WANT TO. 28 | 29 | 30 | 31 | 32 | 33 | MinecraftClient methods: 34 | 35 | 36 | object __construct(string $server [, int $protocol = CURRENT_PROTOCOL [, string $port = "25565"]]) 37 | void logout([string $message = "Quitting"]) 38 | array getInventory() 39 | array getInvetorySlot(int $id) 40 | array changeSlot(int $id) 41 | void stop() 42 | void process([string $stop = "ff"]) 43 | mixed response($eid) 44 | int event(string $event, string $callback [, bool $inObject]) 45 | void action(int microseconds, string code) 46 | void deleteEvent(string $event [, int $id = -1] ) 47 | array ping() 48 | void say(string $message) 49 | void move(float $x, float $y, float $z [, bool $ground = true]) 50 | void useEntity(int $eid [, bool $left = true]) 51 | void dropSlot() 52 | void registerPluginChannel(string $channel) 53 | void unregisterPluginChannel(string $channel) 54 | void sendPluginMessage(string $channel, string $data) 55 | void connect(string $user [, string $password = ""]) NO CODE IS EXECUTED AFTER THIS LINE. BE SURE TO CREATE EVENTS BEFORE THIS LINE 56 | void activateSpout() 57 | void sendSpoutMessage(int PID, int version, string data) 58 | 59 | MapInterface methods 60 | array block getBlock($x, $y, $z) 61 | array blocks getZone($x1, $y1, $z1, $x2, $y2, $z2) 62 | array blocks getRadius($x, $y, $z [, $radius = 4]) -------------------------------------------------------------------------------- /example.php: -------------------------------------------------------------------------------- 1 | ping(); 44 | console("[INFO] Name: ".$info[0]); 45 | console("[INFO] Online players: ".$info[1]); 46 | console("[INFO] Max players: ".$info[2]); 47 | echo PHP_EOL; 48 | $client = new MinecraftClient("127.0.0.1"); //Connect to the server 49 | $client->connect("Player", "password"); //NO CODE IS EXECUTED AFTER THIS LINE. BE SURE TO CREATE EVENTS BEFORE THIS LINE -------------------------------------------------------------------------------- /misc/biomes.php: -------------------------------------------------------------------------------- 1 | "Ocean", 36 | 1 => "Plains", 37 | 2 => "Desert", 38 | 3 => "Extreme Hills", 39 | 4 => "Forest", 40 | 5 => "Taiga", 41 | 6 => "Swampland", 42 | 7 => "River", 43 | 8 => "Hell", 44 | 9 => "Sky", 45 | 10 => "Frozen Ocean", 46 | 11 => "Frozen River", 47 | 12 => "Ice Plains", 48 | 13 => "Ice Mountains", 49 | 14 => "Mushroom Island", 50 | 15 => "Mushroom Island Shore", 51 | 16 => "Beach", 52 | 17 => "Desert Hills", 53 | 18 => "Forest Hills", 54 | 19 => "Taiga Hills", 55 | 20 => "Extreme Hills Edge", 56 | 21 => "Jungle", 57 | 22 => "Jungle Hills", 58 | ); 59 | 60 | 61 | ?> -------------------------------------------------------------------------------- /misc/dependencies.php: -------------------------------------------------------------------------------- 1 | 0){ 40 | console("[ERROR] Use PHP >= 5.3.3", true, true, 0); 41 | ++$errors; 42 | } 43 | 44 | if(version_compare("5.4.0", PHP_VERSION) > 0){ 45 | console("[NOTICE] Use PHP >= 5.4.0 to increase performance", true, true, 0); 46 | define("HEX2BIN", false); 47 | }else{ 48 | define("HEX2BIN", true); 49 | } 50 | 51 | if(php_sapi_name() !== "cli" and defined("CLI_REQUIRED") and CLI_REQUIRED === true){ 52 | console("[ERROR] Use PHP-CLI to execute the client or create your own", true, true, 0); 53 | ++$errors; 54 | } 55 | 56 | if(!extension_loaded("sqlite3")){ 57 | console("[ERROR] Unable to find SQLite3 extension", true, true, 0); 58 | ++$errors; 59 | } 60 | 61 | if(extension_loaded("mcrypt") and mcrypt_module_self_test(MCRYPT_RIJNDAEL_128)){ 62 | define("CRYPTO_LIB", "mcrypt"); 63 | }elseif(!extension_loaded("openssl")){ 64 | console("[NOTICE] Unable to find Mcrypt extension", true, true, 0); 65 | console("[ERROR] [FallBack] Unable to find OpenSSL extension", true, true, 0); 66 | ++$errors; 67 | }else{ 68 | console("[NOTICE] Unable to find Mcrypt extension", true, true, 0); 69 | define("CRYPTO_LIB", "openssl"); 70 | } 71 | 72 | if(!extension_loaded("curl")){ 73 | console("[ERROR] Unable to find cURL extension", true, true, 0); 74 | ++$errors; 75 | } 76 | 77 | if(!extension_loaded("zlib")){ 78 | console("[ERROR] Unable to find Zlib extension", true, true, 0); 79 | ++$errors; 80 | } 81 | 82 | if(!extension_loaded("gd")){ 83 | console("[NOTICE] Unable to find GD extension. You won't be able to use the MapPainter plugin", true, true, 0); 84 | } 85 | 86 | if(!extension_loaded("sockets")){ 87 | console("[ERROR] Unable to find Socket extension", true, true, 0); 88 | ++$errors; 89 | } 90 | 91 | if($errors > 0){ 92 | die(); 93 | } 94 | 95 | gc_enable(); 96 | 97 | require_once("classes/Packet.class.php"); 98 | require_once("classes/Socket.class.php"); 99 | require_once("classes/Entity.class.php"); 100 | require_once("classes/Window.class.php"); 101 | require_once("classes/MapInterface.class.php"); 102 | require_once("classes/Path.class.php"); 103 | require_once("classes/MinecraftInterface.class.php"); 104 | require_once("classes/phpseclib/Crypt/RSA.php"); 105 | require_once("classes/phpseclib/Math/BigInteger.php"); 106 | 107 | ?> -------------------------------------------------------------------------------- /misc/entities.php: -------------------------------------------------------------------------------- 1 | "Creeper", 36 | 51 => "Skeleton", 37 | 52 => "Spider", 38 | 53 => "Giant Zombie", 39 | 54 => "Zombie", 40 | 55 => "Slime", 41 | 56 => "Ghast", 42 | 57 => "Zombie Pigman", 43 | 58 => "Enderman", 44 | 59 => "Cave Spider", 45 | 60 => "Silverfish", 46 | 61 => "Blaze", 47 | 62 => "Magma Cube", 48 | 63 => "Ender Dragon", 49 | 64 => "Wither", 50 | 65 => "Bat", 51 | 66 => "Witch", 52 | 53 | 90 => "Pig", 54 | 91 => "Sheep", 55 | 92 => "Cow", 56 | 93 => "Chicken", 57 | 94 => "Squid", 58 | 95 => "Wolf", 59 | 96 => "Mooshroom", 60 | 97 => "Snowman", 61 | 98 => "Ocelot", 62 | 99 => "Iron Golem", 63 | 64 | 120 => "Villager", 65 | 66 | ); 67 | 68 | $objects = array( 69 | 1 => "Boat", 70 | 71 | 10 => "Minecart", 72 | 11 => "Minecart (storage)", 73 | 12 => "Minecart (powered)", 74 | 75 | 50 => "Activated TNT", 76 | 51 => "EnderCrystal", 77 | 78 | 60 => "Arrow", 79 | 61 => "Snowball", 80 | 62 => "Egg", 81 | 63 => "Fireball", 82 | 64 => "Small Fireball", 83 | 84 | 65 => "Thrown Enderpearl", 85 | 66 => "Wither Skull", 86 | 70 => "Falling Block", 87 | 71 => "Item Frame", 88 | 72 => "Eye of Ender", 89 | 73 => "Thrown Potion", 90 | 74 => "Falling Dragon Egg", 91 | 75 => "Thrown Exp Bottle", 92 | 93 | 90 => "Fishing Float", 94 | 95 | ); 96 | 97 | 98 | ?> -------------------------------------------------------------------------------- /misc/functions.php: -------------------------------------------------------------------------------- 1 | asdf 62 | [1] => asdf 63 | [2] => --help 64 | [3] => --dest=/var/ 65 | [4] => -asd 66 | [5] => -h 67 | [6] => --option mew arf moo 68 | [7] => -z 69 | ) 70 | */ 71 | 72 | $ret = array( 73 | 'input' => array(), 74 | 'commands' => array(), 75 | 'flags' => array() 76 | ); 77 | 78 | foreach ( $args as $arg ) { 79 | 80 | // Is it a command? (prefixed with --) 81 | if ( substr( $arg, 0, 2 ) === '--' ) { 82 | 83 | $value = preg_split( '/[= ]/', $arg, 2 ); 84 | $com = substr( array_shift($value), 2 ); 85 | $value = join($value); 86 | 87 | $ret['commands'][$com] = !empty($value) ? $value : true; 88 | continue; 89 | 90 | } 91 | 92 | // Is it a flag? (prefixed with -) 93 | if ( substr( $arg, 0, 1 ) === '-' ) { 94 | $ret['flags'][] = substr( $arg, 1 ); 95 | continue; 96 | } 97 | 98 | $ret['input'][] = $arg; 99 | continue; 100 | 101 | } 102 | 103 | return $ret; 104 | } 105 | 106 | function console($message, $EOL = true, $log = true, $level = 1){ 107 | //global $path; 108 | if(!defined("DEBUG") or DEBUG >= $level){ 109 | $message .= $EOL === true ? PHP_EOL:""; 110 | $message = date("H:i:s"). " ". $message; 111 | if($log === true and (!defined("LOG") or LOG === true)){ 112 | logg($message, "console", false, $level); 113 | } 114 | echo $message; 115 | } 116 | } 117 | 118 | function logg($message, $name, $EOL = true, $level = 2, $close = false){ 119 | global $fpointers; 120 | if((!defined("DEBUG") or DEBUG >= $level) and (!defined("LOG") or LOG === true)){ 121 | $message .= $EOL === true ? PHP_EOL:""; 122 | if(!isset($fpointers)){ 123 | $fpointers = array(); 124 | } 125 | if(!isset($fpointers[$name])){ 126 | $fpointers[$name] = fopen(FILE_PATH."/".$name.".log", "ab"); 127 | } 128 | fwrite($fpointers[$name], $message); 129 | if($close === true){ 130 | fclose($fpointers[$name]); 131 | unset($fpointers[$name]); 132 | } 133 | } 134 | } -------------------------------------------------------------------------------- /misc/materials.php: -------------------------------------------------------------------------------- 1 | array( 36 | 0 => true, 37 | 6 => true, 38 | /*8 => true, 39 | 9 => true, 40 | 10 => true, 41 | 11 => true,*/ 42 | 20 => true, 43 | //27 => true, 44 | 28 => true, 45 | 29 => true, 46 | 30 => true, 47 | 31 => true, 48 | 32 => true, 49 | 37 => true, 50 | 38 => true, 51 | 39 => true, 52 | 40 => true, 53 | 50 => true, 54 | 55 => true, 55 | 63 => true, 56 | 65 => true, 57 | //66 => true, 58 | 68 => true, 59 | 85 => true, 60 | 101 => true, 61 | 102 => true, 62 | 106 => true, 63 | 107 => true, 64 | ), 65 | "color" => array( 66 | 0 => array(255, 255, 255, 127), 67 | 1 => array(127, 127, 127, 0), 68 | 2 => array(102, 166, 60, 0), 69 | 3 => array(150, 108, 74, 0), 70 | 4 => array(97, 97, 97, 0), 71 | 5 => array(185, 149, 95, 0), 72 | 73 | 7 => array(7, 7, 7, 0), 74 | 8 => array(38, 92, 255, 0), 75 | 9 => array(38, 92, 255, 0), 76 | 10 => array(252, 87, 0, 0), 77 | 11 => array(252, 87, 0, 0), 78 | 12 => array(251, 244, 189, 0), 79 | 13 => array(144, 136, 132, 0), 80 | 14 => array(255, 241, 68, 0), 81 | 15 => array(226, 192, 170, 0), 82 | 16 => array(63, 63, 63, 0), 83 | 17 => array(108, 87, 54, 0), 84 | 18 => array(57, 61, 13, 0), 85 | 21 => array(25, 70, 181), 86 | 22 => array(25, 70, 181), 87 | 23 => array(132, 132, 132, 0), 88 | 24 => array(251, 244, 189, 0), 89 | 27 => array(245, 204, 45, 0), 90 | 28 => array(164, 164, 164, 0), 91 | 29 => array(132, 132, 132, 0), 92 | 33 => array(132, 132, 132, 0), 93 | 35 => array( 94 | 0 => array(221, 221, 221, 0), 95 | 1 => array(219, 125, 62, 0), 96 | 2 => array(179, 80, 188, 0), 97 | 3 => array(107, 138, 201, 0), 98 | 4 => array(177, 166, 39, 0), 99 | 5 => array(65, 174, 56, 0), 100 | 6 => array(208, 132, 153, 0), 101 | 7 => array(64, 64, 64, 0), 102 | 8 => array(154, 154, 154, 0), 103 | 9 => array(46, 110, 137, 0), 104 | 10 => array(126, 61, 181, 0), 105 | 11 => array(46, 56, 141, 0), 106 | 12 => array(79, 50, 31, 0), 107 | 13 => array(53, 70, 27, 0), 108 | 14 => array(150, 52, 48, 0), 109 | 15 => array(25, 22, 22, 0), 110 | ), 111 | 41 => array(255, 241, 68, 0), 112 | 42 => array(230, 230, 230, 0), 113 | 43 => array(168, 168, 168, 0), 114 | 44 => array(168, 168, 168, 0), 115 | 45 => array(151, 83, 61, 0), 116 | 46 => array(219, 68, 26, 0), 117 | 47 => array(185, 149, 95, 0), 118 | 48 => array(97, 97, 97, 0), 119 | 49 => array(19, 19, 28, 0), 120 | 50 => array(255, 188, 94, 0), 121 | 51 => array(255, 188, 94, 0), 122 | 53 => array(159, 132, 77, 0), 123 | 55 => array(213, 24, 24, 0), 124 | 56 => array(160, 235, 232, 0), 125 | 57 => array(160, 235, 232, 0), 126 | 61 => array(132, 132, 132, 0), 127 | 62 => array(132, 132, 132, 0), 128 | 66 => array(164, 164, 164, 0), 129 | 67 => array(97, 97, 97, 0), 130 | 73 => array(213, 24, 24, 0), 131 | 74 => array(213, 24, 24, 0), 132 | 75 => array(213, 24, 24, 0), 133 | 76 => array(213, 24, 24, 0), 134 | 78 => array(255, 255, 255, 0), 135 | 79 => array(136, 136, 217, 0), 136 | 80 => array(255, 255, 255, 0), 137 | 86 => array(227, 170, 0, 0), 138 | 87 => array(96, 6, 6, 0), 139 | 89 => array(255, 188, 94, 0), 140 | 91 => array(227, 170, 0, 0), 141 | 93 => array(213, 24, 24, 0), 142 | 94 => array(213, 24, 24, 0), 143 | 98 => array(168, 168, 168, 0), 144 | 108 => array(151, 83, 61, 0), 145 | 109 => array(168, 168, 168, 0), 146 | 110 => array(102, 166, 60, 0), 147 | 111 => array(127, 127, 127, 0), 148 | 112 => array(74, 42, 48, 0), 149 | 125 => array(185, 149, 95, 0), 150 | 126 => array(185, 149, 95, 0), 151 | 128 => array(251, 244, 189, 0), 152 | 134 => array(185, 149, 95, 0), 153 | 135 => array(185, 149, 95, 0), 154 | 136 => array(185, 149, 95, 0), 155 | ), 156 | 0 => "Air", 157 | 1 => "Stone", 158 | 2 => "Grass", 159 | 3 => "Dirt", 160 | 4 => "Cobblestone", 161 | 5 => "Plank", 162 | 6 => "Sapling", 163 | 7 => "Bedrock", 164 | 8 => "Water", 165 | 9 => "Water", 166 | 10 => "Lava", 167 | 11 => "Lava", 168 | 12 => "Sand", 169 | 13 => "Gravel", 170 | 14 => "Gold Ore", 171 | 15 => "Iron Ore", 172 | 16 => "Coal Ore", 173 | 17 => "Wood", 174 | 18 => "Leave", 175 | 19 => "Sponge", 176 | 20 => "Glass", 177 | 21 => "Lapis Lazuli Ore", 178 | 22 => "Lapis Lazuli Block", 179 | 23 => "Dispenser", 180 | 24 => "Sandstone", 181 | 25 => "Note Block", 182 | 26 => "Bed", 183 | 27 => "Powered Rail", 184 | 28 => "Detector Rail", 185 | 29 => "Sticky Piston", 186 | 30 => "Cobweb", 187 | 31 => "Tall Grass", 188 | 32 => "Dead Bush", 189 | 33 => "Piston", 190 | 34 => "Piston Extension", 191 | 35 => "Wool", 192 | 36 => "Block Entity", 193 | 37 => "Dandelion", 194 | 38 => "Rose", 195 | 39 => "Brown Mushroom", 196 | 40 => "Red Mushroom", 197 | 41 => "Gold Block", 198 | 42 => "Iron Block", 199 | 43 => "Double Slab", 200 | 44 => "Slab", 201 | 45 => "Brick", 202 | 46 => "TNT", 203 | 47 => "Bookshelf", 204 | 48 => "Moss Stone", 205 | 49 => "Obsidian", 206 | 50 => "Torch", 207 | 51 => "Fire", 208 | 52 => "Monster Spawner", 209 | 53 => "Wood Stairs", 210 | 54 => "Chest", 211 | 55 => "Redstone Wire", 212 | 56 => "Diamond Ore", 213 | 57 => "Diamond Block", 214 | 58 => "Crafting Table", 215 | 59 => "Wheat Seeds", 216 | 60 => "Farmland", 217 | 61 => "Furnace", 218 | 62 => "Burning Furnace", 219 | 63 => "Sign", 220 | 64 => "Wood Door", 221 | 65 => "Ladder", 222 | 66 => "Rail", 223 | 67 => "Cobblestone Stairs", 224 | 68 => "Sign", 225 | 69 => "Lever", 226 | 70 => "Stone Pressure Plate", 227 | 71 => "Iron Door", 228 | 72 => "Wood Presure Plate", 229 | 73 => "Redstone Ore", 230 | 74 => "Redstone Ore", 231 | 75 => "Redstone Torch", 232 | 76 => "Redstone Torch", 233 | 77 => "Stone Button", 234 | 78 => "Snow", 235 | 79 => "Ice", 236 | 80 => "Snow Block", 237 | 81 => "Cactus", 238 | 82 => "Clay Block", 239 | 83 => "Sugar Cane", 240 | 84 => "Jukebox", 241 | 85 => "Fence", 242 | 86 => "Pumpkin", 243 | 87 => "Netherrack", 244 | 88 => "Soul Sand", 245 | 89 => "Glowstone", 246 | 90 => "Portal", 247 | 91 => "Jack-O-Lantern", 248 | 92 => "Cake", 249 | 93 => "Repeater", 250 | 94 => "Repeater", 251 | 95 => "Locked Chest", 252 | 96 => "Trapdoor", 253 | 97 => "Monster Egg", 254 | 98 => "Stone Brick", 255 | 99 => "Huge Brown Mushroom", 256 | 100 => "Huge Red Mushroom", 257 | 101 => "Iron Bars", 258 | 102 => "Glass Panel", 259 | 103 => "Melon", 260 | 104 => "Pumpkin Stem", 261 | 105 => "Melon Stem", 262 | 106 => "Vines", 263 | 107 => "Fence Gate", 264 | 108 => "Brick Stairs", 265 | 109 => "Stone Stairs", 266 | 267 | 112 => "Nether Brick", 268 | /* 269 | Continue this 270 | */ 271 | 272 | ); 273 | 274 | $food = array( 275 | 282 => 8, //Stew 276 | 364 => 8, //Steak 277 | 320 => 8, //Porkchop 278 | 366 => 6, //Chicken 279 | 297 => 5, //Bread 280 | 350 => 5, //Fish 281 | 260 => 4, //R Apple 282 | 322 => 4, //G Apple 283 | 363 => 3, //Raw Beef 284 | 319 => 3, //Raw Porkchop 285 | 360 => 2, //Melon 286 | 349 => 2, //Raw fish 287 | 265 => 2, //Raw Chicken 288 | 357 => 1, //Cookie 289 | 367 => 4, //Flesh 290 | 375 => 2, //Spider eye, 291 | ); 292 | 293 | 294 | ?> -------------------------------------------------------------------------------- /plugin/AdvertManager.plugin.php: -------------------------------------------------------------------------------- 1 | timeAds = array(); 38 | $this->spaceAds = array(); 39 | $this->client = $client; 40 | $this->timeLapse = $timeLapse; 41 | $this->timeLast = microtime(true); 42 | $this->event = $this->client->event("onTick", "handler", $this); 43 | console("[INFO] [AdvertManager] Loaded"); 44 | } 45 | 46 | public function addTimeAdvert($text){ 47 | $this->timeAds[] = $text; 48 | } 49 | 50 | public function addSpaceAdvert($text, $name){ 51 | if(!isset($this->spaceAds[$name])){ 52 | $this->spaceAds[$name] = array(); 53 | } 54 | $this->spaceAds[$name][] = $text; 55 | } 56 | 57 | public function handler(){ 58 | $time = microtime(true); 59 | if(($this->timeLast + ($this->timeLapse * 60)) <= $time){ 60 | $this->client->say($this->timeAds[count($this->timeAds)-1]); 61 | $this->timeLast = $time; 62 | } 63 | } 64 | 65 | public function getSpace($name){ 66 | if(isset($this->spaceAds[$name])){ 67 | return $this->spaceAds[$name]; 68 | } 69 | return array(); 70 | } 71 | 72 | public function stop(){ 73 | $this->deleteEvent("onTick", $this->event); 74 | } 75 | 76 | } -------------------------------------------------------------------------------- /plugin/Attack.plugin.php: -------------------------------------------------------------------------------- 1 | client = $client; 40 | $this->player = $this->client->getPlayer(); 41 | $this->aura = false; 42 | $this->boss = false; 43 | $this->playeraura = false; 44 | $this->attack = array(); 45 | $this->special = array(); 46 | $this->event = $this->client->event("onTick", "handler", $this); 47 | console("[INFO] [Attack] Loaded"); 48 | } 49 | 50 | public function addSpecial($lapse, $action){ 51 | $this->special[] = array($lapse, microtime(true), $action); 52 | } 53 | 54 | public function attack($EID){ 55 | $this->attack[$EID] = true; 56 | } 57 | 58 | public function peace($EID){ 59 | unset($this->attack[$EID]); 60 | } 61 | 62 | function handler($time){ 63 | $pos = $this->player->getPosition(); 64 | if($pos === false){ 65 | return; 66 | } 67 | $action = false; 68 | if($this->boss === true){ 69 | foreach($this->special as $i => $info){ 70 | if($info[1] <= ($time - $info[0])){ 71 | $this->special[$i][1] = $time; 72 | $action = $info[2]; 73 | break; 74 | } 75 | } 76 | } 77 | $entities = $this->client->query("SELECT EID,class,x,y,z,name FROM entities WHERE EID != ".$this->player->eid." AND ((class = ".ENTITY_PLAYER." AND abs(x - ".$pos["x"].") <= 20 AND abs(y - ".$pos["y"].") <= 4 AND abs(z - ".$pos["z"].") <= 20)".($this->aura === true ? " OR (class = ".ENTITY_MOB." AND abs(x - ".$pos["x"].") <= 4 AND abs(y - ".$pos["y"].") <= 4 AND abs(z - ".$pos["z"].") <= 4)":"").");"); 78 | if($entities === false or $entities === true){ 79 | return; 80 | } 81 | while($entity = $entities->fetchArray(SQLITE3_ASSOC)){ 82 | if(($entity["class"] === ENTITY_PLAYER and ($this->playeraura === true or isset($this->attack[$entity["EID"]]))) or ($entity["class"] === ENTITY_MOB)){ 83 | $pos2 = array("x" => $entity["x"], "y" => $entity["y"], "z" => $entity["z"]); 84 | $dist = Utils::distance($pos, $pos2); 85 | if((isset($this->attack[$entity["EID"]]) or $this->playeraura === true) and $dist <= 20){ 86 | $this->player->look($pos2); 87 | if($this->action !== false){ 88 | eval(str_replace("{{PLAYER}}", $entity["name"], $action)); 89 | } 90 | } 91 | if($dist <= 4){ 92 | $this->client->useEntity($entity["EID"]); 93 | } 94 | } 95 | } 96 | 97 | } 98 | 99 | } 100 | 101 | 102 | -------------------------------------------------------------------------------- /plugin/CacheFile.plugin.php: -------------------------------------------------------------------------------- 1 | client = $client; 39 | $this->client->event("onSpoutCache", "handler", $this); 40 | $this->client->event("onPlayerSpawn", "handler", $this); 41 | $this->client->event("onPlayerPing", "handler", $this); 42 | console("[INFO] [CacheFile] Loaded"); 43 | } 44 | 45 | public function handler($data, $event){ 46 | $redo = false; 47 | switch($event){ 48 | case "onPluginMessage_MC|TPack": 49 | $dir = "texturepack/"; 50 | $file = substr($data, 0, -2); 51 | break; 52 | case "onSpoutCache": 53 | $dir = "spout/"; 54 | $file = $data["file"]; 55 | break; 56 | case "onPlayerSpawn": 57 | $dir = "skin/"; 58 | $file = "http://s3.amazonaws.com/MinecraftSkins/".$data->name.".png"; 59 | $redo = true; 60 | break; 61 | case "onPlayerPing": 62 | $dir = "skin/"; 63 | $file = "http://s3.amazonaws.com/MinecraftSkins/".$data["name"].".png"; 64 | $redo = true; 65 | break; 66 | } 67 | if(isset($file) and ($redo === true or !file_exists(FILE_PATH . "/data/".$dir . basename($file)))){ 68 | @mkdir(FILE_PATH . "/data/".$dir, 0777, true); 69 | $cnt = @file_get_contents($file); 70 | if($cnt != ""){ 71 | @file_put_contents(FILE_PATH . "/data/".$dir . basename($file), $cnt); 72 | } 73 | } 74 | } 75 | 76 | } 77 | -------------------------------------------------------------------------------- /plugin/ChatCommand.plugin.php: -------------------------------------------------------------------------------- 1 | client = $client; 39 | $this->owners = array(); 40 | $this->commands = array(); 41 | $this->alias = array(); 42 | $this->client->event("onChatHandler", "handler", $this); 43 | $this->addAlias($this->client->getPlayer()->getName()); 44 | console("[INFO] [ChatCommand] Loaded"); 45 | } 46 | 47 | public function addOwner($owner){ 48 | $this->owners[$owner] = $owner; 49 | } 50 | 51 | public function addAlias($alias){ 52 | $this->alias[] = strtolower($alias); 53 | } 54 | 55 | public function addCommand($command, $callback = false, $onlyMe = false, $ownerOnly = false){ 56 | $command = strtolower($command); 57 | if(!isset($this->commands[$command])){ 58 | $this->commands[$command] = array(); 59 | } 60 | $this->commands[$command][] = array($onlyMe, $ownerOnly); 61 | if($callback !== false){ 62 | $this->client->event("onChatCommand_".$command, $callback); 63 | } 64 | } 65 | 66 | public function handler($info){ 67 | $owner = $info["owner"]; 68 | $message = explode(" ",$info["message"]); 69 | $command = strtolower(array_shift($message)); 70 | 71 | foreach($this->alias as $alias){ 72 | if($command === $alias){ 73 | $command = strtolower(array_shift($message)); 74 | $info["type"] = "private"; 75 | break; 76 | } 77 | } 78 | if(isset($this->commands[$command])){ 79 | console("[DEBUG] [ChatCommand] Command by ".$owner.": ".$command, true, true, 2); 80 | foreach($this->commands[$command] as $c){ 81 | if(($c[1] == false or ($c[1] == true and isset($this->owners[$owner]))) and (($c[0] == true and $info["type"] == "private") or $c[0] == false)){ 82 | $this->client->trigger("onChatCommand_".$command, array("text" => implode(" ", $message), "owner" => $owner, "channel" => $info["world"])); 83 | }elseif((($c[0] == true and $info["type"] == "private") or $c[0] == false) and $c[1] == true and !isset($this->owners[$owner])){ 84 | $this->client->trigger("onChatCommand_NO_PERMISSIONS", array("command" => $command, "owner" => $owner, "channel" => $info["world"])); 85 | } 86 | } 87 | } 88 | return false; 89 | } 90 | } -------------------------------------------------------------------------------- /plugin/ChatHandler.plugin.php: -------------------------------------------------------------------------------- 1 | client = $client; 40 | if($only === true){ 41 | $this->client->deleteEvent("onChat"); 42 | } 43 | $this->blacklist = $blacklist; 44 | $this->event = $this->client->event("onChat", "handler", $this); 45 | console("[INFO] [ChatHandler] Loaded"); 46 | } 47 | 48 | public function stop(){ 49 | $this->client->deleteEvent("onChat", $this->event); 50 | } 51 | 52 | public function handler($data, $event, $ob){ 53 | $mess = str_replace(array("[Server]", "", "[Broadcast]", ""), array("", "", "", ""), preg_replace("/\xa7[a-z0-9]/", "", $data)); 54 | $message = ""; 55 | $type = "global"; 56 | $group = ""; 57 | $world = ""; 58 | $owner = ""; 59 | $receptor = ""; 60 | if(preg_match("/\* ([a-zA-Z0-9_~]{2,16}) /",$mess,$username) > 0){ //Default MP 61 | $owner = $username[1]; 62 | //$type = "me"; 63 | $message = ltrim(substr($mess, strpos($mess, $username[0]) + strlen($username[0]))); 64 | }elseif(preg_match("/([a-zA-Z0-9_~]{2,16}) whispers to ([a-zA-Z0-9_]{2,16}):/",$mess,$username) > 0){ //Default MP 65 | $owner = $username[1]; 66 | $type = "private"; 67 | $receptor = $username[2]; 68 | $message = ltrim(substr($mess, strpos($mess, $username[0]) + strlen($username[0]))); 69 | }elseif(preg_match("/([a-zA-Z0-9_~]{2,16}) whispers /",$mess,$username) > 0){ // CraftBukkit 70 | $owner = $username[1]; 71 | $type = "private"; 72 | $receptor = "you"; 73 | $message = ltrim(substr($mess, strpos($mess, $username[0]) + strlen($username[0]))); 74 | }elseif(preg_match("/\[([a-zA-Z0-9_~]{2,16}) \-> ([a-zA-Z0-9_]{2,16})\]/",$mess,$username) > 0){ //Essentials MP 75 | $owner = $username[1]; 76 | if($owner != "me" and $owner != "yo"){ 77 | $type = "private"; 78 | } 79 | $receptor = $username[2]; 80 | $message = ltrim(substr($mess, strpos($mess, $username[0]) + strlen($username[0]))); 81 | }elseif(preg_match("#([\(<\{][ ]{0,1}|)([a-zA-Z0-9_]{2,16})(:|[ ]{0,1}[\)>\}])#", $mess, $username) > 0){ //Catch them all!! 82 | if(preg_match("#[\[]([a-zA-Z0-9\-_ |]*)[\]]#", $mess, $zone) > 0){ 83 | $zone = explode("|", $zone[1]); 84 | if(count($zone) > 1){ 85 | $world = $zone[0]; 86 | $group = $zone[1]; 87 | }else{ 88 | $group = $zone[0]; 89 | } 90 | } 91 | $owner = trim($username[2]); 92 | $message = ltrim(substr($mess, strpos($mess, $username[0]) + strlen($username[0]))); 93 | }elseif(preg_match("/([a-zA-Z0-9_]{2,16}) ([a-z]*) the game/",$mess,$username) > 0){ 94 | $owner = $username[1]; 95 | $type = $username[2] === "joined" ? "join":"left"; 96 | }elseif(preg_match("/([a-zA-Z0-9_]{2,16}) (drowned|hit the ground too hard|was (slain|shot|killed|fireballed|pummeled) by |fell out of the world|tried to swim in lava|went up in flames|burned to death|suffocated in a wall|was pricked to death|starved to death|died|withered away)([a-zA-Z0-9_]{0,16})/",$mess,$username) > 0){ 97 | $owner = $username[1]; 98 | $type = "kill"; 99 | $receptor = $username[4]; 100 | $message = "was killed".($receptor != "" ? " by ".$receptor:""); 101 | }else{ 102 | $message = trim($mess); 103 | if($mess === ""){ 104 | return array("owner" => "", "receptor" => "", "group" => "", "world" => "", "message" => "", "type" => ""); 105 | } 106 | } 107 | $info = array("owner" => $owner, "receptor" => $receptor, "group" => $group, "world" => $world, "message" => $message, "type" => $type, "raw" => $mess); 108 | if($event != "internal"){ 109 | console("[INTERNAL] [ChatHandler] ".ChatHandler::format($info), true, true, 3); 110 | if(isset($this->blacklist[$owner])){ 111 | $this->client->trigger("onChatHandler_blacklisted", $info); 112 | }else{ 113 | $this->client->trigger("onChatHandler", $info); 114 | } 115 | }else{ 116 | return $info; 117 | } 118 | } 119 | 120 | public static function format($info){ 121 | if(!is_array($info)){ 122 | $info = @ChatHandler::handler($info, "internal", null); 123 | } 124 | if($info["type"] === "private" or $info["receptor"] != ""){ 125 | return "[".$info["owner"]." -> ".$info["receptor"]."] ".$info["message"]; 126 | }elseif($info["type"] === "join"){ 127 | return "<".$info["owner"]."> joined the game"; 128 | }elseif($info["type"] === "left"){ 129 | return "<".$info["owner"]."> left the game"; 130 | }else{ 131 | return ($info["world"] != "" ? "[".$info["world"]."|".$info["group"]."] ":($info["group"] != "" ? "[".$info["group"]."] ":"")).($info["owner"] != "" ? "<".$info["owner"].($info["type"] == "private" ? " -> me":"")."> ":"").$info["message"]; 132 | } 133 | } 134 | 135 | 136 | } -------------------------------------------------------------------------------- /plugin/Follow.plugin.php: -------------------------------------------------------------------------------- 1 | eid = $EID; 39 | $this->client = $client; 40 | $this->start = microtime(true); 41 | $this->event = $this->client->event("onEntityMove_".$EID, "onMove", $this); 42 | $this->event2 = $this->client->event("onTick", "followPath", $this); 43 | $this->path = array(); 44 | } 45 | public function onMove($entity){ 46 | $coords = $entity->getPosition(); 47 | $this->path[] = array("time" => microtime(true) - $this->start, "coords" => array("x" => $coords["x"], "y" => $coords["y"], "z" => $coords["z"])); 48 | } 49 | public function followPath($time, $event, $ob){ 50 | if(count($this->path) === 0){ 51 | return; 52 | } 53 | foreach($this->path as $i => $data){ 54 | if($data["time"] <= (microtime(true) - $this->start)){ 55 | $ob->move($data["coords"]["x"], $data["coords"]["y"], $data["coords"]["z"]); 56 | unset($this->path[$i]); 57 | } 58 | break; 59 | } 60 | 61 | } 62 | public function stop(){ 63 | $this->client->deleteEvent("onEntityMove_".$this->eid, $this->event); 64 | $this->client->deleteEvent("onTick", $this->event2); 65 | } 66 | } -------------------------------------------------------------------------------- /plugin/LagOMeter.plugin.php: -------------------------------------------------------------------------------- 1 | client = $client; 39 | $this->lag = false; 40 | $this->last = microtime(true); 41 | $this->minTime = $minTime; 42 | console("[INFO] [LagOMeter] Loaded"); 43 | $this->ev1 = $this->client->event("onRecievedPacket", "handler", $this); 44 | $this->ev2 = $this->client->event("onTick", "meter", $this); 45 | } 46 | 47 | public function handler($data){ 48 | $this->last = microtime(true); 49 | } 50 | 51 | public function meter(){ 52 | if($this->lag === true){ 53 | if($this->last > $this->start){ 54 | $this->lag = false; 55 | $this->client->trigger("onLagEnd", microtime(true) - $this->start); 56 | console("[DEBUG] [LagOMeter] Lag ended (".(microtime(true) - $this->start)." sec)", true, true, 2); 57 | }else{ 58 | $this->client->trigger("onLag", microtime(true) - $this->start); 59 | } 60 | }elseif((microtime(true) - $this->last) >= $this->minTime){ 61 | $this->lag = true; 62 | $this->start = $this->last; 63 | $this->client->trigger("onLagStart"); 64 | console("[DEBUG] [LagOMeter] Lag started", true, true, 2); 65 | } 66 | } 67 | 68 | public function stop(){ 69 | $this->client->deleteEvent("onPacketRecieved", $this->ev1); 70 | $this->client->deleteEvent("onTick", $this->ev2); 71 | } 72 | 73 | 74 | } -------------------------------------------------------------------------------- /plugin/LastLogin.plugin.php: -------------------------------------------------------------------------------- 1 | generate($keystring, $salt, (int) $iterations, (int) $segments, $hash); 14 | $this->des = new Crypt_DES(CRYPT_DES_MODE_CBC); 15 | $this->des->setKey($this->key); 16 | $this->des->setIV($this->IV); 17 | } 18 | 19 | private function generate($keystring, $salt, $iterations, $segments, $hash){ 20 | switch($hash){ 21 | default: 22 | case 1: 23 | $hashFunction = "md5"; 24 | $hashLenght = 16; 25 | break; 26 | case 2: 27 | $hashFunction = "sha1"; 28 | $hashLenght = 20; 29 | break; 30 | } 31 | 32 | $data = $keystring . $salt; 33 | $result = ""; 34 | for($j = 0; $j < $segments; ++$j){ 35 | $result .= $data; 36 | for($i = 0; $i < $iterations; ++$i){ 37 | $result = $hashFunction($result, true); 38 | } 39 | } 40 | $this->key = substr($result, 0, 8); 41 | $this->IV = substr($result, 8, 8); 42 | } 43 | 44 | public function encrypt($plaintext){ 45 | return $this->des->encrypt($plaintext); 46 | } 47 | 48 | public function decrypt($ciphertext){ 49 | return $this->des->decrypt($ciphertext); 50 | } 51 | } 52 | 53 | 54 | class LastLogin{ 55 | private $crypt, $location; 56 | function __construct(){ 57 | $this->crypt = new PKCSKeyGenerator("passwordfile", "\x0c\x9d\x4a\xe4\x1e\x83\x15\xfc", 5, 1, PKCS_MD5); 58 | $this->location = LastLogin::getLocation(); 59 | } 60 | 61 | public static function getLocation(){ 62 | $home = getenv("home"); 63 | $os = strtolower(php_uname("s")); 64 | if(strpos($os, "win") !== false){ 65 | $location = getenv("appdata"); 66 | if($location === ""){ 67 | $location = ($home != "") ? $home : getenv("homepath"); 68 | } 69 | $location .= '/.minecraft/'; 70 | }elseif(strpos($os, "linux") !== false or strpos($os, "unix") !== false or strpos($os, "solaris") !== false or strpos($os, "sunos") !== false){ 71 | $location = $home . '/.minecraft/'; 72 | }elseif(strpos($os, "mac") !== false){ 73 | $location = $home . '/Library/Application Support/minecraft/'; 74 | }else{ 75 | $location = $home . '/.minecraft/'; 76 | } 77 | return $location . 'lastlogin'; 78 | } 79 | 80 | public function get(){ 81 | if(!file_exists($this->location)){ 82 | return array("username" => false, "password" => false); 83 | } 84 | $data = $this->crypt->decrypt(file_get_contents($this->location)); 85 | $offset = 0; 86 | $len = Utils::readShort(substr($data, $offset, 2)); 87 | $offset += 2; 88 | $username = substr($data, $offset, $len); 89 | $offset += $len; 90 | $len = Utils::readShort(substr($data, $offset, 2)); 91 | $offset += 2; 92 | $password = substr($data, $offset, $len); 93 | $offset += $len; 94 | console("[DEBUG] [LastLogin] Got Credentials", true, true, 2); 95 | return array("username" => $username, "password" => $password); 96 | } 97 | 98 | public function set($username, $password){ 99 | file_put_contents($this->location, $this->crypt->encrypt(strlen($username).$username.strlen($password).$password)); 100 | console("[DEBUG] [LastLogin] Set Credentials", true, true, 2); 101 | } 102 | 103 | } -------------------------------------------------------------------------------- /plugin/MapPainter.plugin.php: -------------------------------------------------------------------------------- 1 | map = $client->map; 40 | $this->player = $client->getPlayer(); 41 | include("misc/materials.php"); 42 | $this->material = $material; 43 | console("[INFO] [MapPainter] loaded"); 44 | } 45 | 46 | public function getMap($floor = -1, $radius = 16, $blockSize = 1, $startY = -1){ 47 | $map = array(); 48 | $pos = $this->player->getPosition(true); 49 | $radius = $radius * $blockSize; 50 | $startX = $pos["x"] - $radius; 51 | $startZ = $pos["z"] - $radius; 52 | $endX = $pos["x"] + $radius; 53 | $endZ = $pos["z"] + $radius; 54 | $i = 0; 55 | $j = 0; 56 | for($x = $startX; $x < $endX; $x += $blockSize){ 57 | $map[$i] = array(); 58 | $j = 0; 59 | for($z = $startZ; $z < $endZ; $z += $blockSize){ 60 | if($floor === -1){ 61 | $map[$i][$j] = $this->map->getFloor($x, $z, $startY); 62 | }else{ 63 | $b = $this->map->getBlock($x, $floor, $z); 64 | $map[$i][$j] = array(0, $b[0], $b[1]); 65 | } 66 | ++$j; 67 | } 68 | ++$i; 69 | } 70 | return $map; 71 | } 72 | 73 | public function scan($dest, $radius = 16, $width = 8){ 74 | $dest = str_replace(".png", "", $dest); 75 | for($y = 0; $y < HEIGHT_LIMIT; ++$y){ 76 | $this->drawMap($dest."_".$y.".png", $y, $radius, $width); 77 | } 78 | } 79 | 80 | public function drawMap($dest, $floor = -1, $radius = 16, $width = 1, $blockSize = 1, $startY = -1){ 81 | $s = ($radius << 1) * $width; 82 | $map = $this->getMap($floor, $radius, $blockSize, $startY); 83 | $img = imagecreatetruecolor($s, $s); 84 | $c =& $this->material["color"]; 85 | foreach($map as $x => $d){ 86 | foreach($d as $z => $block){ 87 | $y = $block[0]; 88 | $b = $block[1]; 89 | $m = $block[2]; 90 | $color = isset($c[$b]) ? 91 | (isset($c[$b][$m][0]) ? 92 | imagecolorallocatealpha($img, 93 | max(0, $c[$b][$m][0] - (($y % 3) << 4)), 94 | max(0, $c[$b][$m][1] - (($y % 3) << 4)), 95 | max(0, $c[$b][$m][2] - (($y % 3) << 4)), 96 | max(0, $c[$b][$m][3] - (($y % 3) << 4)) 97 | ) 98 | : 99 | imagecolorallocatealpha($img, 100 | max(0, $c[$b][0] - (($y % 3) << 4)), 101 | max(0, $c[$b][1] - (($y % 3) << 4)), 102 | max(0, $c[$b][2] - (($y % 3) << 4)), 103 | max(0, $c[$b][3] - (($y % 3) << 4)) 104 | ) 105 | ) 106 | : 107 | imagecolorallocatealpha($img, 214, 127, 255, 0); 108 | 109 | for($i = 0; $i < $width; ++$i){ 110 | for($j = 0; $j < $width; ++$j){ 111 | imagesetpixel($img, $x * $width + $i, $z * $width + $j, $color); 112 | } 113 | } 114 | } 115 | } 116 | imagepng($img, $dest, 9); 117 | imagedestroy($img); 118 | console("[DEBUG] [MapPainter] Drawed map radius ".$radius, true, true, 2); 119 | } 120 | } -------------------------------------------------------------------------------- /plugin/Navigation.plugin.php: -------------------------------------------------------------------------------- 1 | client = $client; 41 | $this->player = $this->client->getPlayer(); 42 | $this->map = $this->client->map; 43 | include("misc/materials.php"); 44 | $this->material = $material; 45 | $this->client->event("onSpoutBlock", "spoutBlock", $this); 46 | $this->last = microtime(true); 47 | $this->maxBlocksPerTick = 0.2; //speed 48 | $this->fly = false; 49 | $this->speedY = 0; 50 | $this->event = $this->client->event("onTick", "walker", $this); 51 | $this->path = null; 52 | $this->b = null; 53 | console("[INFO] [Navigation] Loaded"); 54 | } 55 | 56 | public function go($x, $y, $z){ 57 | $this->lastBlock = array($this->player->getPosition(true), 0); 58 | $this->path = new PathFind($this->client, $this->lastBlock[0], array("x" => $x, "y" => $y, "z" => $z)); 59 | var_dump($this->path->path); 60 | } 61 | 62 | public function stop(){ 63 | $this->deleteEvent("onTick", $this->event); 64 | } 65 | 66 | 67 | public function isSolid($block){ 68 | if(isset($this->material["nosolid"][$block])){ 69 | return true; 70 | } 71 | return false; 72 | } 73 | 74 | public function walker($time){ 75 | $pos = $this->player->getPosition(); 76 | if($pos === false or $pos["y"] < 0){ 77 | return false; 78 | } 79 | 80 | if($this->path !== null){ 81 | if($this->lastBlock[1] === 0){ 82 | $this->lastBlock = array($this->b, 10); 83 | $this->b = $this->path->getNextBlock(); 84 | } 85 | if($this->b !== null){ 86 | $pos["x"] += ($this->b["x"] - $this->lastBlock["x"]) / $this->maxBlocksPerTick; 87 | $pos["y"] += ($this->b["y"] - $this->lastBlock["y"]) / $this->maxBlocksPerTick; 88 | $pos["z"] += ($this->b["z"] - $this->lastBlock["z"]) / $this->maxBlocksPerTick; 89 | --$this->lastBlock[1]; 90 | }else{ 91 | $this->path = null; 92 | } 93 | }else{ 94 | $zone = $this->getZone(1,true); 95 | if(isset($zone[0][0][-1]) and $this->isSolid($zone[0][0][-1][0]) and $this->fly === false){ //Air 96 | $this->speedY += 0.9; 97 | $pos["y"] -= $this->speedY; 98 | $pos["ground"] = false; 99 | }elseif($this->fly === false){ 100 | $pos["y"] = floor($pos["y"]); 101 | $this->speedY = 0; 102 | $pos["ground"] = true; 103 | } 104 | } 105 | 106 | $this->player->setPosition($pos["x"],$pos["y"],$pos["z"],$pos["stance"],$pos["yaw"],$pos["pitch"],$pos["ground"]); 107 | } 108 | 109 | public function spoutBlock($data){ 110 | $this->material[$data["id"]] = $data["info"]; 111 | } 112 | 113 | public function getBlockName($id){ 114 | if(isset($this->material[$id])){ 115 | return $this->material[$id]; 116 | } 117 | return "Unknown"; 118 | } 119 | 120 | public function getBlock($x, $y, $z){ 121 | return $this->map->getBlock($x, $y, $z); 122 | } 123 | 124 | public function getColumn($x, $z){ 125 | return $this->map->getColumn($x, $z); 126 | } 127 | 128 | public function getRelativeBlock($x = 0, $y = 0, $z = 0){ 129 | $pos = $this->player->getPosition(true); 130 | if($pos === false){ 131 | return false; 132 | } 133 | return $this->map->getBlock($pos["x"] + $x, $pos["y"] + $y, $pos["z"] + $z); 134 | } 135 | 136 | public function getRelativeColumn($x, $z){ 137 | $pos = $this->player->getPosition(true); 138 | if($pos === false){ 139 | return false; 140 | } 141 | $data = $this->map->getColumn($pos["x"], $pos["z"]); 142 | if($relative === true){ 143 | $data2 = array(); 144 | foreach($data as $x => $a1){ 145 | $data2[$x - $pos["x"]] = array(); 146 | foreach($a1 as $z => $a2){ 147 | $data2[$x - $pos["x"]][$z - $pos["z"]] = array(); 148 | foreach($a2 as $y => $block){ 149 | $data2[$x - $pos["x"]][$z - $pos["z"]][$y - $pos["y"]] = $block; 150 | } 151 | } 152 | } 153 | return $data2; 154 | } 155 | return $data; 156 | } 157 | 158 | public function getZone($radius = 16, $relative = false){ 159 | $pos = $this->player->getPosition(true); 160 | if($pos === false){ 161 | return false; 162 | } 163 | $data = $this->map->getSphere($pos["x"], $pos["y"], $pos["z"], $radius); 164 | if($relative === true){ 165 | $data2 = array(); 166 | foreach($data as $x => $a1){ 167 | $data2[$x - $pos["x"]] = array(); 168 | foreach($a1 as $z => $a2){ 169 | $data2[$x - $pos["x"]][$z - $pos["z"]] = array(); 170 | foreach($a2 as $y => $block){ 171 | $data2[$x - $pos["x"]][$z - $pos["z"]][$y - $pos["y"]] = $block; 172 | } 173 | } 174 | } 175 | return $data2; 176 | } 177 | return $data; 178 | } 179 | 180 | } 181 | 182 | 183 | -------------------------------------------------------------------------------- /plugin/NoHunger.plugin.php: -------------------------------------------------------------------------------- 1 | client = $client; 39 | $this->player = $this->client->getPlayer(); 40 | $this->client->event("onHealthChange", "handler", $this); 41 | $this->client->event("onInventoryChanged", "handler", $this); 42 | $this->only_food = $only_food; 43 | console("[INFO] [NoHunger] Loaded"); 44 | } 45 | 46 | public function setOnlyFood($only_food){ 47 | $this->only_food = $only_food; 48 | } 49 | public function handler($health, $event){ 50 | include("misc/materials.php"); 51 | for($i=36;$i<=44;++$i){ 52 | $slot = $this->client->getInventorySlot($i); 53 | if($event === "onHealthChange" and isset($food[$slot[0]]) === true and ($health["food"] + $food[$slot[0]]) <= 20){ 54 | $this->client->changeSlot($i-36); 55 | $this->client->eatSlot(); 56 | $eat = true; 57 | console("[DEBUG] [NoHunger] Eated ".$slot[0], true, true, 2); 58 | break; 59 | }elseif(!isset($food[$slot[0]]) and $this->only_food === true){ 60 | for($a=0;$aclient->changeSlot($i-36); 62 | $this->client->dropSlot(); 63 | } 64 | } 65 | } 66 | } 67 | 68 | } 69 | -------------------------------------------------------------------------------- /plugin/PathFind.plugin.php: -------------------------------------------------------------------------------- 1 | client = $client; 40 | include("misc/materials.php"); 41 | $this->nosolid = $material["nosolid"]; 42 | $this->nosolid[10] = true; 43 | $this->nosolid[11] = true; 44 | $this->start = $start; 45 | $this->end = $end; 46 | $this->path = new Path; 47 | $this->open = new Path; 48 | $this->closed = new Path; 49 | $this->look($this->start, (int) $max); 50 | } 51 | 52 | private function look($pos, $max){ 53 | $rep = 0; 54 | while(($pos["x"] != $this->end["x"] or $pos["y"] != $this->end["y"] or $pos["z"] != $this->end["z"]) and $rep < $max){ 55 | ++$rep; 56 | $this->closed->add($pos); 57 | $this->open->remove($pos); 58 | for($i = -1; $i <= 1; ++$i) { 59 | for($j = -1; $j <= 1; ++$j) { 60 | for($k = -1; $k <= 1; ++$k) { 61 | $adjacentBlock = array("x" => $pos["x"] + $i, "y" => $pos["y"] + $j, "z" => $pos["z"] + $k); 62 | if($adjacentBlock["x"] != $this->end["x"] or $adjacentBlock["y"] != $this->end["y"] or $adjacentBlock["z"] != $this->end["z"]){ 63 | $next = $this->client->map->getBlock($pos["x"] + $i, $pos["y"] + $j - 1, $pos["z"] + $k); 64 | if(!($j === 1 and $next[0] === 85)){ 65 | $this->scoreBlock($adjacentBlock, $pos); 66 | } 67 | } 68 | } 69 | } 70 | } 71 | $n = $this->open->toArray(); 72 | usort($n, array($this, "nodeComp")); 73 | if (count($n) === 0) { 74 | break; 75 | } 76 | $pos = $n[0]; 77 | if($pos["x"] === $this->end["x"] and $pos["y"] === $this->end["y"] and $pos["z"] === $this->end["z"]){ 78 | $adjacentBlock = $pos; 79 | while($adjacentBlock != null and ($adjacentBlock["x"] != $this->start["x"] or $adjacentBlock["y"] != $this->start["y"] or $adjacentBlock["z"] != $this->start["z"])) { 80 | $this->path->add($adjacentBlock); 81 | $adjacentBlock = $adjacentBlock["parent"]; 82 | } 83 | $this->path->reverse(); 84 | } 85 | } 86 | if ($this->path->size() === 0) { 87 | $this->path->add($this->end); 88 | } 89 | 90 | 91 | 92 | } 93 | 94 | public function getNextBlock(){ 95 | if($this->path->size() > 0){ 96 | $r = $this->path->get(0); 97 | $this->path->remove($r); 98 | return $r; 99 | } 100 | return null; 101 | } 102 | 103 | public function nodeComp($o1, $o2){ 104 | $o1 = isset($o1["f"]) ? $o1["f"]:0; 105 | $o2 = isset($o2["f"]) ? $o2["f"]:0; 106 | if($o1 > $o2){ 107 | return 1; 108 | }elseif($o1 < $o2){ 109 | return -1; 110 | } 111 | return 0; 112 | } 113 | 114 | private function scoreBlock($pos, $parent){ 115 | $xZDiagonal = ($pos["x"] != $parent["x"] and $pos["z"] != $parent["z"]); 116 | $xYDiagonal = ($pos["x"] != $parent["x"] and $pos["y"] != $parent["y"]); 117 | $yZDiagonal = ($pos["y"] != $parent["y"] and $pos["z"] != $parent["z"]); 118 | $b = $this->client->map->getBlock($pos["x"], $pos["y"], $pos["z"]); 119 | $floor = $this->client->map->getBlock($pos["x"], $pos["y"] - 1, $pos["z"]); 120 | $ceil = $this->client->map->getBlock($pos["x"], $pos["y"] + 1, $pos["z"]); 121 | if((isset($this->nosolid[$b[0]]) and !isset($this->nosolid[$floor[0]]) and isset($this->nosolid[$ceil[0]])) or ($pos["x"] == $this->end["x"] and $pos["y"] == $this->end["y"] and $pos["z"] == $this->end["z"])){ 122 | if(!$this->open->contains($pos) and !$this->closed->contains($pos)){ 123 | $pos["parent"] = $parent; 124 | $pos["g"] = (isset($parent["g"]) ? $parent["g"]:0) + (($xZDiagonal or $xYDiagonal or $yZDiagonal) ? 14 : 10); 125 | $difX = abs($this->end["x"] - $pos["x"]); 126 | $difY = abs($this->end["y"] - $pos["y"]); 127 | $difZ = abs($this->end["z"] - $pos["z"]); 128 | $pos["h"] = ($difX + $difY + $difZ) * 10; 129 | $pos["f"] = $pos["g"] + $pos["h"]; 130 | $this->open->add($pos); 131 | }elseif(!$this->closed->contains($pos)){ 132 | $g = (isset($parent["g"]) ? $parent["g"]:0) + (($xZDiagonal or $xYDiagonal or $yZDiagonal) ? 14 : 10); 133 | if($g < (isset($pos["g"]) ? $pos["g"]:0)){ 134 | $pos["g"] = $g; 135 | $pos["parent"] = $parent; 136 | } 137 | } 138 | } 139 | } 140 | 141 | } 142 | 143 | 144 | -------------------------------------------------------------------------------- /plugin/QuestionFAQ.plugin.php: -------------------------------------------------------------------------------- 1 | client = $client; 40 | $this->event = $this->client->event("onChatHandler", "handler", $this); 41 | $this->question = array(); 42 | $this->response = array(); 43 | $this->state = array(); 44 | console("[INFO] [QuestionFAQ] Loaded"); 45 | } 46 | 47 | public function addQuestionTrigger($txt){ 48 | $this->question[] = strtolower($txt); 49 | } 50 | 51 | public function addResponse($fixedWords, $optionalWords, $noWords, $question, $response, $call = false){ 52 | $this->response[] = array(explode(",",strtolower($fixedWords)), explode(",",strtolower($optionalWords)), explode(",",strtolower($noWords)), $question, $response, $call); 53 | } 54 | 55 | public function toggleState($user){ 56 | $this->state[$user] = (isset($this->state[$user]) and $this->state[$user] == true) ? false:true; 57 | } 58 | 59 | public function handler($message){ 60 | if((isset($this->state[$message["owner"]]) and $this->state[$message["owner"]] === false) or !isset($this->state[$message["owner"]])){ 61 | $owner = $message["owner"]; 62 | $type = $message["type"]; 63 | $message = " ".trim(strtolower($message["message"]))." "; 64 | if($type == "private"){ 65 | $question = true; 66 | }else{ 67 | $question = false; 68 | foreach($this->question as $q){ 69 | if($q != "" and strpos($message, $q) !== false){ 70 | $question = true; 71 | console("[DEBUG] [QuestionFAQ] Detected question", true, true, 2); 72 | break; 73 | } 74 | } 75 | } 76 | 77 | 78 | $best = array(); 79 | foreach($this->response as $i => $data){ 80 | if(($data[3] == true and $question == true) or $data[3] == false){ 81 | $points = 0; 82 | if(count($data[0]) > 1 or $data[0][0] != ""){ 83 | $continue = false; 84 | foreach($data[0] as $word){ 85 | if($word != "" and strpos($message, $word) !== false){ 86 | $continue = true; 87 | ++$points; 88 | } 89 | } 90 | if($continue == false){ 91 | continue; 92 | } 93 | } 94 | if(count($data[1]) > 1 or $data[1][0] != ""){ 95 | $continue = false; 96 | foreach($data[1] as $word){ 97 | if($word != "" and strpos($message, $word) !== false){ 98 | $points += 2; 99 | $continue = true; 100 | } 101 | } 102 | if($continue == false){ 103 | continue; 104 | } 105 | } 106 | if(count($data[2]) > 1 or $data[2][0] != ""){ 107 | $continue = true; 108 | foreach($data[2] as $word){ 109 | if($word != "" and strpos($message, $word) !== false){ 110 | $continue = false; 111 | break; 112 | } 113 | } 114 | if($continue == false){ 115 | continue; 116 | } 117 | } 118 | if($points == 0){ 119 | continue; 120 | } 121 | $best[$i] = $points; 122 | } 123 | } 124 | if(count($best) > 0){ 125 | arsort($best); 126 | $p = reset($best); 127 | $best = key($best); 128 | console("[DEBUG] [QuestionFAQ] Chosen response with punctuation ".$p." over ".count($best)." responses", true, true, 2); 129 | if($this->response[$best][5] !== false){ 130 | call_user_func($this->response[$best][4], $owner, $this->response[$best][5], $this->client); 131 | }else{ 132 | $this->client->say($this->response[$best][4], $owner); 133 | } 134 | } 135 | } 136 | } 137 | 138 | public function stop(){ 139 | $this->client->deleteEvent("onChatHandler", $this->event); 140 | } 141 | 142 | } -------------------------------------------------------------------------------- /plugin/Record.plugin.php: -------------------------------------------------------------------------------- 1 | eid = $EID; 38 | $this->client = $client; 39 | $this->start = microtime(true); 40 | $this->event = $this->client->event("onEntityMove_".$EID, "onMove", $this); 41 | $this->path = array(); 42 | } 43 | public function onMove($entity){ 44 | $coords = $entity->getPosition(); 45 | $this->path[] = array("time" => microtime(true) - $this->start, "coords" => array("x" => $coords["x"], "y" => $coords["y"], "z" => $coords["z"])); 46 | } 47 | public function getPath(){ 48 | return $this->path; 49 | } 50 | public function stop(){ 51 | $this->client->deleteEvent("onEntityMove_".$this->eid, $this->event); 52 | } 53 | } 54 | 55 | 56 | class PlayPath{ 57 | protected $start, $path, $event, $client; 58 | function __construct($client, $path){ 59 | $this->client = $client; 60 | $this->start = microtime(true); 61 | $this->event = $this->client->event("onTick", "followPath", $this); 62 | $this->path = $path; 63 | } 64 | public function followPath($time, $event, $ob){ 65 | foreach($this->path as $i => $data){ 66 | if($data["time"] <= microtime(true) - $this->start){ 67 | $ob->move($data["coords"]["x"], $data["coords"]["y"], $data["coords"]["z"]); 68 | unset($this->path[$i]); 69 | } 70 | break; 71 | } 72 | if(count($this->path) == 0){ 73 | $this->stop(); 74 | } 75 | } 76 | public function stop(){ 77 | $this->client->deleteEvent("onTick", $this->event); 78 | } 79 | } -------------------------------------------------------------------------------- /plugin/RemoteConsole.plugin.php: -------------------------------------------------------------------------------- 1 | client = $client; 40 | $this->clients = array(); 41 | $this->socket = new Socket("127.0.0.1", (int) $port, true); 42 | $this->event = $this->client->event("onTick", "recieve", $this); 43 | $this->event2 = $this->client->event("onChat", "send", $this); 44 | $this->users = array(); 45 | $this->login = array(); 46 | console("[INFO] [RemoteConsole] Loaded"); 47 | } 48 | 49 | public function addUser($username, $password){ 50 | $this->users[$username] = md5($password); 51 | } 52 | 53 | public function send($data){ 54 | $data = preg_replace("/\xa7[a-z0-9]/", "", $data); 55 | foreach($this->clients as $i => $client){ 56 | if(isset($this->logins[$i])){ 57 | $client->write("\x03".Utils::writeInt(strlen($data)).$data); 58 | } 59 | } 60 | } 61 | 62 | public function recieve(){ 63 | $connection = $this->socket->listenSocket(); 64 | if($connection !== false and $connection !== null){ 65 | $this->clients[] = $connection; 66 | socket_getpeername($connection->sock, $ip, $port); 67 | $this->client->trigger("onRemoteConsoleConnect", array("ip" => $ip, "port" => $port)); 68 | } 69 | foreach($this->clients as $i => $client){ 70 | if(isset($this->logins[$i])){ 71 | continue; 72 | } 73 | if(($pid = $client->read(1, true)) !== false){ 74 | $pid = ord($pid); 75 | if(!isset($this->logins[$i]) and $pid !== 1){ 76 | $client->close(); 77 | unset($this->clients[$i]); 78 | continue; 79 | } 80 | switch($pid){ 81 | case 1: 82 | $username = $client->read(Utils::readShort($client->read(2))); 83 | $password = $client->read(Utils::readShort($client->read(2))); 84 | if(isset($this->users[$username]) and $this->users[$username] === md5($password)){ 85 | socket_getpeername($connection->sock, $ip, $port); 86 | $this->client->trigger("onRemoteConsoleJoin", array("ip" => $ip, "port" => $port, "username" => $username)); 87 | $this->logins[$i] = $username; 88 | }else{ 89 | $client->close(); 90 | unset($this->clients[$i]); 91 | } 92 | break; 93 | case 2: 94 | $this->client->trigger("onRemoteConsoleLeave", $this->logins[$i]); 95 | $client->write("\x02"); 96 | $client->close(); 97 | unset($this->clients[$i]); 98 | unset($this->logins[$i]); 99 | break; 100 | case 3: 101 | $text = $client->read(Utils::readInt($client->read(4))); 102 | $this->client->say("#".$username.": ".$text); 103 | break; 104 | case 4: 105 | $text = $client->read(Utils::readInt($client->read(4))); 106 | $this->client->say($text); 107 | break; 108 | } 109 | } 110 | } 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /plugin/Stats.plugin.php: -------------------------------------------------------------------------------- 1 | file = $file; 40 | $this->load(); 41 | console("[INFO] [Stats] Loaded"); 42 | } 43 | 44 | public function delete($stat){ 45 | unset($this->stats[$stat]); 46 | $this->save(); 47 | } 48 | 49 | public function reset(){ 50 | $this->stats = array(); 51 | $this->save(); 52 | } 53 | 54 | public function set($stat, $value){ 55 | $this->stats[$stat] = $value; 56 | $this->save(); 57 | } 58 | 59 | public function get($stat){ 60 | if(isset($this->stats[$stat])){ 61 | return $this->stats[$stat]; 62 | } 63 | return 0; 64 | } 65 | 66 | public function increment($stat, $value = 1){ 67 | if(!isset($this->stats[$stat])){ 68 | $this->stats[$stat] = 0; 69 | } 70 | $this->stats[$stat] += $value; 71 | $this->save(); 72 | } 73 | 74 | public function add($stat, $value){ 75 | if(!isset($this->stats[$stat])){ 76 | $this->stats[$stat] = array(); 77 | } 78 | $this->stats[$stat][] = $value; 79 | $this->save(); 80 | } 81 | 82 | protected function load(){ 83 | if(file_exists($this->file)){ 84 | $this->stats = unserialize(file_get_contents($this->file)); 85 | }else{ 86 | $this->stats = array(); 87 | } 88 | } 89 | 90 | protected function save(){ 91 | file_put_contents($this->file, serialize($this->stats)); 92 | } 93 | 94 | 95 | } -------------------------------------------------------------------------------- /pstruct/22.php: -------------------------------------------------------------------------------- 1 | array( 40 | "int", 41 | ), 42 | 43 | 0x01 => array( 44 | "int", 45 | "string", 46 | "long", 47 | "int", 48 | "byte", 49 | "byte", 50 | "ubyte", 51 | "ubyte", 52 | ), 53 | 54 | 0x02 => array( 55 | "string", 56 | ), 57 | 58 | 0x03 => array( 59 | "string", 60 | ), 61 | 62 | 0x04 => array( 63 | "long", 64 | ), 65 | 66 | 0x05 => array( 67 | "int", 68 | "short", 69 | "short", 70 | "short", 71 | ), 72 | 73 | 0x06 => array( 74 | "int", 75 | "int", 76 | "int", 77 | ), 78 | 79 | 0x08 => array( 80 | "short", 81 | "short", 82 | "float", 83 | ), 84 | 85 | 0x09 => array( 86 | "byte", 87 | "byte", 88 | "byte", 89 | "short", 90 | "long", 91 | ), 92 | 93 | 0x0d => array( 94 | "double", 95 | "double", 96 | "double", 97 | "double", 98 | "float", 99 | "float", 100 | "bool", 101 | ), 102 | 103 | 0x10 => array( 104 | "short", 105 | ), 106 | 107 | 0x11 => array( 108 | "int", 109 | "byte", 110 | "int", 111 | "byte", 112 | "int", 113 | ), 114 | 115 | 0x12 => array( 116 | "int", 117 | "byte", 118 | ), 119 | 120 | 0x14 => array( 121 | "int", 122 | "string", 123 | "int", 124 | "int", 125 | "int", 126 | "byte", 127 | "byte", 128 | "short", 129 | ), 130 | 131 | 0x15 => array( 132 | "int", 133 | "short", 134 | "byte", 135 | "short", 136 | "int", 137 | "int", 138 | "int", 139 | "byte", 140 | "byte", 141 | "byte", 142 | ), 143 | 144 | 0x16 => array( 145 | "int", 146 | "int", 147 | ), 148 | 149 | 0x17 => array( 150 | "int", 151 | "byte", 152 | "int", 153 | "int", 154 | "int", 155 | "int", //if >0, fireball 156 | "short", 157 | "short", 158 | "short", 159 | ), 160 | 161 | 0x18 => array( 162 | "int", 163 | "byte", 164 | "int", 165 | "int", 166 | "int", 167 | "byte", 168 | "byte", 169 | "entityMetadata", 170 | ), 171 | 172 | 0x19 => array( 173 | "int", 174 | "string", 175 | "int", 176 | "int", 177 | "int", 178 | "int", 179 | ), 180 | 181 | 0x1a => array( 182 | "int", 183 | "int", 184 | "int", 185 | "int", 186 | "short", 187 | ), 188 | 189 | 0x1b => array( 190 | "float", 191 | "float", 192 | "float", 193 | "float", 194 | "bool", 195 | "bool", 196 | ), 197 | 198 | 0x1c => array( 199 | "int", 200 | "short", 201 | "short", 202 | "short", 203 | ), 204 | 205 | 0x1d => array( 206 | "int", 207 | ), 208 | 209 | 0x1e => array( 210 | "int", 211 | ), 212 | 213 | 0x1f => array( 214 | "int", 215 | "byte", 216 | "byte", 217 | "byte", 218 | ), 219 | 220 | 0x20 => array( 221 | "int", 222 | "byte", 223 | "byte", 224 | ), 225 | 226 | 0x21 => array( 227 | "int", 228 | "byte", 229 | "byte", 230 | "byte", 231 | "byte", 232 | "byte", 233 | ), 234 | 235 | 0x22 => array( 236 | "int", 237 | "int", 238 | "int", 239 | "int", 240 | "byte", 241 | "byte", 242 | ), 243 | 244 | 0x26 => array( 245 | "int", 246 | "byte", 247 | ), 248 | 249 | 0x27 => array( 250 | "int", 251 | "int", 252 | ), 253 | 254 | 0x28 => array( 255 | "int", 256 | "entityMetadata", 257 | ), 258 | 259 | 0x29 => array( 260 | "int", 261 | "byte", 262 | "byte", 263 | "short", 264 | ), 265 | 266 | 0x2a => array( 267 | "int", 268 | "byte", 269 | ), 270 | 271 | 0x2b => array( 272 | "float", 273 | "short", 274 | "short", 275 | ), 276 | 277 | 0x32 => array( 278 | "int", 279 | "int", 280 | "bool", 281 | ), 282 | 283 | 0x33 => array( 284 | "int", 285 | "short", 286 | "int", 287 | "byte", 288 | "byte", 289 | "byte", 290 | "int", 291 | "chunkArray", 292 | ), 293 | 294 | 0x34 => array( 295 | "int", 296 | "int", 297 | "short", 298 | "multiblockArray", 299 | ), 300 | 301 | 0x35 => array( 302 | "int", 303 | "byte", 304 | "int", 305 | "byte", 306 | "byte", 307 | ), 308 | 309 | 0x36 => array( 310 | "int", 311 | "short", 312 | "int", 313 | "byte", 314 | "byte", 315 | ), 316 | 317 | 0x3c => array( 318 | "double", 319 | "double", 320 | "double", 321 | "float", 322 | "int", 323 | "explosionRecord" 324 | ), 325 | 326 | 0x3d => array( 327 | "int", 328 | "int", 329 | "byte", 330 | "int", 331 | "int", 332 | ), 333 | 334 | 0x46 => array( 335 | "byte", 336 | "byte", 337 | ), 338 | 339 | 0x47 => array( 340 | "int", 341 | "bool", 342 | "int", 343 | "int", 344 | "int", 345 | ), 346 | 347 | 0x64 => array( 348 | "byte", 349 | "byte", 350 | "string", 351 | "byte", 352 | ), 353 | 354 | 0x65 => array( 355 | "byte", 356 | ), 357 | 358 | 0x67 => array( 359 | "byte", 360 | "short", 361 | "slotData", 362 | ), 363 | 364 | 0x68 => array( 365 | "byte", 366 | "short", 367 | "slotArray", 368 | ), 369 | 370 | 0x69 => array( 371 | "byte", 372 | "short", 373 | "short", 374 | ), 375 | 376 | 0x6a => array( 377 | "byte", 378 | "short", 379 | "bool", 380 | ), 381 | 382 | 0x6b => array( 383 | "short", 384 | "slotData", 385 | ), 386 | 387 | 0x6c => array( 388 | "byte", 389 | 390 | ), 391 | 392 | 0x82 => array( 393 | "int", 394 | "short", 395 | "int", 396 | "string", 397 | "string", 398 | "string", 399 | "string", 400 | ), 401 | 402 | 0x83 => array( 403 | "short", 404 | "short", 405 | "ubyte", 406 | "byteArray", 407 | ), 408 | 409 | 0xc8 => array( 410 | "int", 411 | "byte", 412 | ), 413 | 414 | 0xc9 => array( 415 | "string", 416 | "byte", 417 | "short", 418 | ), 419 | 420 | 0xcb => array( 421 | "string", 422 | ), 423 | 424 | 0xfa => array( 425 | "string", 426 | "short", 427 | "byteArray", 428 | ), 429 | 430 | 0xfe => array( 431 | "string", 432 | ), 433 | 434 | 0xff => array( 435 | "string", 436 | ), 437 | ); 438 | 439 | 440 | ?> -------------------------------------------------------------------------------- /pstruct/23.php: -------------------------------------------------------------------------------- 1 | array( 40 | "int", 41 | ), 42 | 43 | 0x01 => array( 44 | "int", 45 | "string", 46 | "long", 47 | "string", 48 | "int", 49 | "byte", 50 | "byte", 51 | "ubyte", 52 | "ubyte", 53 | ), 54 | 55 | 0x02 => array( 56 | "string", 57 | ), 58 | 59 | 0x03 => array( 60 | "string", 61 | ), 62 | 63 | 0x04 => array( 64 | "long", 65 | ), 66 | 67 | 0x05 => array( 68 | "int", 69 | "short", 70 | "short", 71 | "short", 72 | ), 73 | 74 | 0x06 => array( 75 | "int", 76 | "int", 77 | "int", 78 | ), 79 | 80 | 0x08 => array( 81 | "short", 82 | "short", 83 | "float", 84 | ), 85 | 86 | 0x09 => array( 87 | "byte", 88 | "byte", 89 | "byte", 90 | "short", 91 | "long", 92 | "string", 93 | ), 94 | 95 | 0x0d => array( 96 | "double", 97 | "double", 98 | "double", 99 | "double", 100 | "float", 101 | "float", 102 | "bool", 103 | ), 104 | 105 | 0x10 => array( 106 | "short", 107 | ), 108 | 109 | 0x11 => array( 110 | "int", 111 | "byte", 112 | "int", 113 | "byte", 114 | "int", 115 | ), 116 | 117 | 0x12 => array( 118 | "int", 119 | "byte", 120 | ), 121 | 122 | 0x14 => array( 123 | "int", 124 | "string", 125 | "int", 126 | "int", 127 | "int", 128 | "byte", 129 | "byte", 130 | "short", 131 | ), 132 | 133 | 0x15 => array( 134 | "int", 135 | "short", 136 | "byte", 137 | "short", 138 | "int", 139 | "int", 140 | "int", 141 | "byte", 142 | "byte", 143 | "byte", 144 | ), 145 | 146 | 0x16 => array( 147 | "int", 148 | "int", 149 | ), 150 | 151 | 0x17 => array( 152 | "int", 153 | "byte", 154 | "int", 155 | "int", 156 | "int", 157 | "int", //if >0, fireball 158 | "short", 159 | "short", 160 | "short", 161 | ), 162 | 163 | 0x18 => array( 164 | "int", 165 | "byte", 166 | "int", 167 | "int", 168 | "int", 169 | "byte", 170 | "byte", 171 | "entityMetadata", 172 | ), 173 | 174 | 0x19 => array( 175 | "int", 176 | "string", 177 | "int", 178 | "int", 179 | "int", 180 | "int", 181 | ), 182 | 183 | 0x1a => array( 184 | "int", 185 | "int", 186 | "int", 187 | "int", 188 | "short", 189 | ), 190 | 191 | 0x1c => array( 192 | "int", 193 | "short", 194 | "short", 195 | "short", 196 | ), 197 | 198 | 0x1d => array( 199 | "int", 200 | ), 201 | 202 | 0x1e => array( 203 | "int", 204 | ), 205 | 206 | 0x1f => array( 207 | "int", 208 | "byte", 209 | "byte", 210 | "byte", 211 | ), 212 | 213 | 0x20 => array( 214 | "int", 215 | "byte", 216 | "byte", 217 | ), 218 | 219 | 0x21 => array( 220 | "int", 221 | "byte", 222 | "byte", 223 | "byte", 224 | "byte", 225 | "byte", 226 | ), 227 | 228 | 0x22 => array( 229 | "int", 230 | "int", 231 | "int", 232 | "int", 233 | "byte", 234 | "byte", 235 | ), 236 | 237 | 0x26 => array( 238 | "int", 239 | "byte", 240 | ), 241 | 242 | 0x27 => array( 243 | "int", 244 | "int", 245 | ), 246 | 247 | 0x28 => array( 248 | "int", 249 | "entityMetadata", 250 | ), 251 | 252 | 0x29 => array( 253 | "int", 254 | "byte", 255 | "byte", 256 | "short", 257 | ), 258 | 259 | 0x2a => array( 260 | "int", 261 | "byte", 262 | ), 263 | 264 | 0x2b => array( 265 | "float", 266 | "short", 267 | "short", 268 | ), 269 | 270 | 0x32 => array( 271 | "int", 272 | "int", 273 | "bool", 274 | ), 275 | 276 | 0x33 => array( 277 | "int", 278 | "short", 279 | "int", 280 | "byte", 281 | "byte", 282 | "byte", 283 | "int", 284 | "chunkArray", 285 | ), 286 | 287 | 0x34 => array( 288 | "int", 289 | "int", 290 | "short", 291 | "multiblockArray", 292 | ), 293 | 294 | 0x35 => array( 295 | "int", 296 | "byte", 297 | "int", 298 | "byte", 299 | "byte", 300 | ), 301 | 302 | 0x36 => array( 303 | "int", 304 | "short", 305 | "int", 306 | "byte", 307 | "byte", 308 | ), 309 | 310 | 0x3c => array( 311 | "double", 312 | "double", 313 | "double", 314 | "float", 315 | "int", 316 | "explosionRecord" 317 | ), 318 | 319 | 0x3d => array( 320 | "int", 321 | "int", 322 | "byte", 323 | "int", 324 | "int", 325 | ), 326 | 327 | 0x46 => array( 328 | "byte", 329 | "byte", 330 | ), 331 | 332 | 0x47 => array( 333 | "int", 334 | "bool", 335 | "int", 336 | "int", 337 | "int", 338 | ), 339 | 340 | 0x64 => array( 341 | "byte", 342 | "byte", 343 | "string", 344 | "byte", 345 | ), 346 | 347 | 0x65 => array( 348 | "byte", 349 | ), 350 | 351 | 0x67 => array( 352 | "byte", 353 | "short", 354 | "slotData", 355 | ), 356 | 357 | 0x68 => array( 358 | "byte", 359 | "short", 360 | "slotArray", 361 | ), 362 | 363 | 0x69 => array( 364 | "byte", 365 | "short", 366 | "short", 367 | ), 368 | 369 | 0x6a => array( 370 | "byte", 371 | "short", 372 | "bool", 373 | ), 374 | 375 | 0x6b => array( 376 | "short", 377 | "slotData", 378 | ), 379 | 380 | 0x6c => array( 381 | "byte", 382 | 383 | ), 384 | 385 | 0x82 => array( 386 | "int", 387 | "short", 388 | "int", 389 | "string", 390 | "string", 391 | "string", 392 | "string", 393 | ), 394 | 395 | 0x83 => array( 396 | "short", 397 | "short", 398 | "ubyte", 399 | "byteArray", 400 | ), 401 | 402 | 0xc8 => array( 403 | "int", 404 | "byte", 405 | ), 406 | 407 | 0xc9 => array( 408 | "string", 409 | "byte", 410 | "short", 411 | ), 412 | 413 | 0xcb => array( 414 | "string", 415 | ), 416 | 417 | 0xfa => array( 418 | "string", 419 | "short", 420 | "byteArray", 421 | ), 422 | 423 | 0xfe => array( 424 | "string", 425 | ), 426 | 427 | 0xff => array( 428 | "string", 429 | ), 430 | ); 431 | 432 | 433 | ?> -------------------------------------------------------------------------------- /pstruct/28.php: -------------------------------------------------------------------------------- 1 | array( 40 | "int", 41 | ), 42 | 43 | 0x01 => array( 44 | "int", 45 | "string", 46 | "string", 47 | "int", 48 | "int", 49 | "byte", 50 | "ubyte", 51 | "ubyte", 52 | ), 53 | 54 | 0x02 => array( 55 | "string", 56 | ), 57 | 58 | 0x03 => array( 59 | "string", 60 | ), 61 | 62 | 0x04 => array( 63 | "long", 64 | ), 65 | 66 | 0x05 => array( 67 | "int", 68 | "short", 69 | "short", 70 | "short", 71 | ), 72 | 73 | 0x06 => array( 74 | "int", 75 | "int", 76 | "int", 77 | ), 78 | 79 | 0x07 => array( 80 | "int", 81 | "int", 82 | "bool", 83 | ), 84 | 85 | 0x08 => array( 86 | "short", 87 | "short", 88 | "float", 89 | ), 90 | 91 | 0x09 => array( 92 | "int", 93 | "byte", 94 | "byte", 95 | "short", 96 | "string", 97 | ), 98 | 99 | 0x0a => array( 100 | "bool", 101 | ), 102 | 103 | 0x0b => array( 104 | "double", 105 | "double", 106 | "double", 107 | "double", 108 | "bool", 109 | ), 110 | 111 | 0x0c => array( 112 | "float", 113 | "float", 114 | "bool", 115 | ), 116 | 117 | 0x0d => array( 118 | "double", 119 | "double", 120 | "double", 121 | "double", 122 | "float", 123 | "float", 124 | "bool", 125 | ), 126 | 127 | 0x0e => array( 128 | "byte", 129 | "int", 130 | "byte", 131 | "int", 132 | "byte", 133 | ), 134 | 135 | 0x0f => array( 136 | "int", 137 | "ubyte", 138 | "int", 139 | "byte", 140 | "slotData", 141 | ), 142 | 143 | 0x10 => array( 144 | "short", 145 | ), 146 | 147 | 0x11 => array( 148 | "int", 149 | "byte", 150 | "int", 151 | "byte", 152 | "int", 153 | ), 154 | 155 | 0x12 => array( 156 | "int", 157 | "byte", 158 | ), 159 | 160 | 0x13 => array( 161 | "int", 162 | "byte", 163 | ), 164 | 165 | 0x14 => array( 166 | "int", 167 | "string", 168 | "int", 169 | "int", 170 | "int", 171 | "byte", 172 | "byte", 173 | "short", 174 | ), 175 | 176 | 0x15 => array( 177 | "int", 178 | "short", 179 | "byte", 180 | "short", 181 | "int", 182 | "int", 183 | "int", 184 | "byte", 185 | "byte", 186 | "byte", 187 | ), 188 | 189 | 0x16 => array( 190 | "int", 191 | "int", 192 | ), 193 | 194 | 0x17 => array( 195 | "int", 196 | "byte", 197 | "int", 198 | "int", 199 | "int", 200 | "int", //if >0, fireball 201 | "short", 202 | "short", 203 | "short", 204 | ), 205 | 206 | 0x18 => array( 207 | "int", 208 | "byte", 209 | "int", 210 | "int", 211 | "int", 212 | "byte", 213 | "byte", 214 | "byte", 215 | "entityMetadata", 216 | ), 217 | 218 | 0x19 => array( 219 | "int", 220 | "string", 221 | "int", 222 | "int", 223 | "int", 224 | "int", 225 | ), 226 | 227 | 0x1a => array( 228 | "int", 229 | "int", 230 | "int", 231 | "int", 232 | "short", 233 | ), 234 | 235 | 0x1c => array( 236 | "int", 237 | "short", 238 | "short", 239 | "short", 240 | ), 241 | 242 | 0x1d => array( 243 | "int", 244 | ), 245 | 246 | 0x1e => array( 247 | "int", 248 | ), 249 | 250 | 0x1f => array( 251 | "int", 252 | "byte", 253 | "byte", 254 | "byte", 255 | ), 256 | 257 | 0x20 => array( 258 | "int", 259 | "byte", 260 | "byte", 261 | ), 262 | 263 | 0x21 => array( 264 | "int", 265 | "byte", 266 | "byte", 267 | "byte", 268 | "byte", 269 | "byte", 270 | ), 271 | 272 | 0x22 => array( 273 | "int", 274 | "int", 275 | "int", 276 | "int", 277 | "byte", 278 | "byte", 279 | ), 280 | 281 | 0x23 => array( 282 | "int", 283 | "byte", 284 | ), 285 | 286 | 0x26 => array( 287 | "int", 288 | "byte", 289 | ), 290 | 291 | 0x27 => array( 292 | "int", 293 | "int", 294 | ), 295 | 296 | 0x28 => array( 297 | "int", 298 | "entityMetadata", 299 | ), 300 | 301 | 0x29 => array( 302 | "int", 303 | "byte", 304 | "byte", 305 | "short", 306 | ), 307 | 308 | 0x2a => array( 309 | "int", 310 | "byte", 311 | ), 312 | 313 | 0x2b => array( 314 | "float", 315 | "short", 316 | "short", 317 | ), 318 | 319 | 0x32 => array( 320 | "int", 321 | "int", 322 | "bool", 323 | ), 324 | 325 | 0x33 => array( 326 | "int", 327 | "int", 328 | "bool", 329 | "short", 330 | "short", 331 | "int", 332 | "int", 333 | "newChunkArray", 334 | ), 335 | 336 | 0x34 => array( 337 | "int", 338 | "int", 339 | "short", 340 | "int", 341 | "newMultiblockArray", 342 | ), 343 | 344 | 0x35 => array( 345 | "int", 346 | "byte", 347 | "int", 348 | "byte", 349 | "byte", 350 | ), 351 | 352 | 0x36 => array( 353 | "int", 354 | "short", 355 | "int", 356 | "byte", 357 | "byte", 358 | ), 359 | 360 | 0x3c => array( 361 | "double", 362 | "double", 363 | "double", 364 | "float", 365 | "int", 366 | "explosionRecord" 367 | ), 368 | 369 | 0x3d => array( 370 | "int", 371 | "int", 372 | "byte", 373 | "int", 374 | "int", 375 | ), 376 | 377 | 0x46 => array( 378 | "byte", 379 | "byte", 380 | ), 381 | 382 | 0x47 => array( 383 | "int", 384 | "bool", 385 | "int", 386 | "int", 387 | "int", 388 | ), 389 | 390 | 0x64 => array( 391 | "byte", 392 | "byte", 393 | "string", 394 | "byte", 395 | ), 396 | 397 | 0x65 => array( 398 | "byte", 399 | ), 400 | 401 | 0x66 => array( 402 | "byte", 403 | "short", 404 | "byte", 405 | "short", 406 | "bool", 407 | "slotData", 408 | ), 409 | 410 | 0x67 => array( 411 | "byte", 412 | "short", 413 | "slotData", 414 | ), 415 | 416 | 0x68 => array( 417 | "byte", 418 | "short", 419 | "slotArray", 420 | ), 421 | 422 | 0x69 => array( 423 | "byte", 424 | "short", 425 | "short", 426 | ), 427 | 428 | 0x6a => array( 429 | "byte", 430 | "short", 431 | "bool", 432 | ), 433 | 434 | 0x6b => array( 435 | "short", 436 | "slotData", 437 | ), 438 | 439 | 0x6c => array( 440 | "byte", 441 | "byte", 442 | ), 443 | 444 | 0x82 => array( 445 | "int", 446 | "short", 447 | "int", 448 | "string", 449 | "string", 450 | "string", 451 | "string", 452 | ), 453 | 454 | 0x83 => array( 455 | "short", 456 | "short", 457 | "ubyte", 458 | "byteArray", 459 | ), 460 | 461 | 0x84 => array( 462 | "int", 463 | "short", 464 | "int", 465 | "byte", 466 | "int", 467 | "int", 468 | "int", 469 | ), 470 | 471 | 0xc8 => array( 472 | "int", 473 | "byte", 474 | ), 475 | 476 | 0xc9 => array( 477 | "string", 478 | "byte", 479 | "short", 480 | ), 481 | 482 | 0xcb => array( 483 | "string", 484 | ), 485 | 486 | 0xfa => array( 487 | "string", 488 | "short", 489 | "byteArray", 490 | ), 491 | 492 | 0xfe => array( 493 | ), 494 | 495 | 0xff => array( 496 | "string", 497 | ), 498 | ); 499 | 500 | 501 | ?> -------------------------------------------------------------------------------- /pstruct/29.php: -------------------------------------------------------------------------------- 1 | array( 40 | "int", 41 | ), 42 | 43 | 0x01 => array( 44 | "int", 45 | "string", 46 | "string", 47 | "int", 48 | "int", 49 | "byte", 50 | "ubyte", 51 | "ubyte", 52 | ), 53 | 54 | 0x02 => array( 55 | "string", 56 | ), 57 | 58 | 0x03 => array( 59 | "string", 60 | ), 61 | 62 | 0x04 => array( 63 | "long", 64 | ), 65 | 66 | 0x05 => array( 67 | "int", 68 | "short", 69 | "short", 70 | "short", 71 | ), 72 | 73 | 0x06 => array( 74 | "int", 75 | "int", 76 | "int", 77 | ), 78 | 79 | 0x07 => array( 80 | "int", 81 | "int", 82 | "bool", 83 | ), 84 | 85 | 0x08 => array( 86 | "short", 87 | "short", 88 | "float", 89 | ), 90 | 91 | 0x09 => array( 92 | "int", 93 | "byte", 94 | "byte", 95 | "short", 96 | "string", 97 | ), 98 | 99 | 0x0a => array( 100 | "bool", 101 | ), 102 | 103 | 0x0b => array( 104 | "double", 105 | "double", 106 | "double", 107 | "double", 108 | "bool", 109 | ), 110 | 111 | 0x0c => array( 112 | "float", 113 | "float", 114 | "bool", 115 | ), 116 | 117 | 0x0d => array( 118 | "double", 119 | "double", 120 | "double", 121 | "double", 122 | "float", 123 | "float", 124 | "bool", 125 | ), 126 | 127 | 0x0e => array( 128 | "byte", 129 | "int", 130 | "byte", 131 | "int", 132 | "byte", 133 | ), 134 | 135 | 0x0f => array( 136 | "int", 137 | "ubyte", 138 | "int", 139 | "byte", 140 | "slotData", 141 | ), 142 | 143 | 0x10 => array( 144 | "short", 145 | ), 146 | 147 | 0x11 => array( 148 | "int", 149 | "byte", 150 | "int", 151 | "byte", 152 | "int", 153 | ), 154 | 155 | 0x12 => array( 156 | "int", 157 | "byte", 158 | ), 159 | 160 | 0x13 => array( 161 | "int", 162 | "byte", 163 | ), 164 | 165 | 0x14 => array( 166 | "int", 167 | "string", 168 | "int", 169 | "int", 170 | "int", 171 | "byte", 172 | "byte", 173 | "short", 174 | ), 175 | 176 | 0x15 => array( 177 | "int", 178 | "short", 179 | "byte", 180 | "short", 181 | "int", 182 | "int", 183 | "int", 184 | "byte", 185 | "byte", 186 | "byte", 187 | ), 188 | 189 | 0x16 => array( 190 | "int", 191 | "int", 192 | ), 193 | 194 | 0x17 => array( 195 | "int", 196 | "byte", 197 | "int", 198 | "int", 199 | "int", 200 | "int", //if >0, fireball 201 | "short", 202 | "short", 203 | "short", 204 | ), 205 | 206 | 0x18 => array( 207 | "int", 208 | "byte", 209 | "int", 210 | "int", 211 | "int", 212 | "byte", 213 | "byte", 214 | "byte", 215 | "entityMetadata", 216 | ), 217 | 218 | 0x19 => array( 219 | "int", 220 | "string", 221 | "int", 222 | "int", 223 | "int", 224 | "int", 225 | ), 226 | 227 | 0x1a => array( 228 | "int", 229 | "int", 230 | "int", 231 | "int", 232 | "short", 233 | ), 234 | 235 | 0x1c => array( 236 | "int", 237 | "short", 238 | "short", 239 | "short", 240 | ), 241 | 242 | 0x1d => array( 243 | "int", 244 | ), 245 | 246 | 0x1e => array( 247 | "int", 248 | ), 249 | 250 | 0x1f => array( 251 | "int", 252 | "byte", 253 | "byte", 254 | "byte", 255 | ), 256 | 257 | 0x20 => array( 258 | "int", 259 | "byte", 260 | "byte", 261 | ), 262 | 263 | 0x21 => array( 264 | "int", 265 | "byte", 266 | "byte", 267 | "byte", 268 | "byte", 269 | "byte", 270 | ), 271 | 272 | 0x22 => array( 273 | "int", 274 | "int", 275 | "int", 276 | "int", 277 | "byte", 278 | "byte", 279 | ), 280 | 281 | 0x23 => array( 282 | "int", 283 | "byte", 284 | ), 285 | 286 | 0x26 => array( 287 | "int", 288 | "byte", 289 | ), 290 | 291 | 0x27 => array( 292 | "int", 293 | "int", 294 | ), 295 | 296 | 0x28 => array( 297 | "int", 298 | "entityMetadata", 299 | ), 300 | 301 | 0x29 => array( 302 | "int", 303 | "byte", 304 | "byte", 305 | "short", 306 | ), 307 | 308 | 0x2a => array( 309 | "int", 310 | "byte", 311 | ), 312 | 313 | 0x2b => array( 314 | "float", 315 | "short", 316 | "short", 317 | ), 318 | 319 | 0x32 => array( 320 | "int", 321 | "int", 322 | "bool", 323 | ), 324 | 325 | 0x33 => array( 326 | "int", 327 | "int", 328 | "bool", 329 | "short", 330 | "short", 331 | "int", 332 | "int", 333 | "newChunkArray", 334 | ), 335 | 336 | 0x34 => array( 337 | "int", 338 | "int", 339 | "short", 340 | "int", 341 | "newMultiblockArray", 342 | ), 343 | 344 | 0x35 => array( 345 | "int", 346 | "byte", 347 | "int", 348 | "byte", 349 | "byte", 350 | ), 351 | 352 | 0x36 => array( 353 | "int", 354 | "short", 355 | "int", 356 | "byte", 357 | "byte", 358 | ), 359 | 360 | 0x3c => array( 361 | "double", 362 | "double", 363 | "double", 364 | "float", 365 | "int", 366 | "explosionRecord" 367 | ), 368 | 369 | 0x3d => array( 370 | "int", 371 | "int", 372 | "byte", 373 | "int", 374 | "int", 375 | ), 376 | 377 | 0x46 => array( 378 | "byte", 379 | "byte", 380 | ), 381 | 382 | 0x47 => array( 383 | "int", 384 | "bool", 385 | "int", 386 | "int", 387 | "int", 388 | ), 389 | 390 | 0x64 => array( 391 | "byte", 392 | "byte", 393 | "string", 394 | "byte", 395 | ), 396 | 397 | 0x65 => array( 398 | "byte", 399 | ), 400 | 401 | 0x66 => array( 402 | "byte", 403 | "short", 404 | "byte", 405 | "short", 406 | "bool", 407 | "slotData", 408 | ), 409 | 410 | 0x67 => array( 411 | "byte", 412 | "short", 413 | "slotData", 414 | ), 415 | 416 | 0x68 => array( 417 | "byte", 418 | "short", 419 | "slotArray", 420 | ), 421 | 422 | 0x69 => array( 423 | "byte", 424 | "short", 425 | "short", 426 | ), 427 | 428 | 0x6a => array( 429 | "byte", 430 | "short", 431 | "bool", 432 | ), 433 | 434 | 0x6b => array( 435 | "short", 436 | "slotData", 437 | ), 438 | 439 | 0x6c => array( 440 | "byte", 441 | "byte", 442 | ), 443 | 444 | 0x82 => array( 445 | "int", 446 | "short", 447 | "int", 448 | "string", 449 | "string", 450 | "string", 451 | "string", 452 | ), 453 | 454 | 0x83 => array( 455 | "short", 456 | "short", 457 | "ubyte", 458 | "byteArray", 459 | ), 460 | 461 | 0x84 => array( 462 | "int", 463 | "short", 464 | "int", 465 | "byte", 466 | "int", 467 | "int", 468 | "int", 469 | ), 470 | 471 | 0xc8 => array( 472 | "int", 473 | "byte", 474 | ), 475 | 476 | 0xc9 => array( 477 | "string", 478 | "byte", 479 | "short", 480 | ), 481 | 482 | 0xca => array( 483 | "bool", 484 | "bool", 485 | "bool", 486 | "bool", 487 | ), 488 | 489 | 0xcb => array( 490 | "string", 491 | ), 492 | 493 | 0xfa => array( 494 | "string", 495 | "short", 496 | "byteArray", 497 | ), 498 | 499 | 0xfe => array( 500 | ), 501 | 502 | 0xff => array( 503 | "string", 504 | ), 505 | ); 506 | 507 | 508 | ?> -------------------------------------------------------------------------------- /pstruct/38.php: -------------------------------------------------------------------------------- 1 | array( 40 | "int", 41 | ), 42 | 43 | 0x01 => array( 44 | "int", 45 | "string", 46 | "byte", 47 | "byte", 48 | "byte", 49 | "ubyte", 50 | "ubyte", 51 | ), 52 | 53 | 0x02 => array( 54 | "byte", 55 | "string", 56 | "string", 57 | "int", 58 | ), 59 | 60 | 0x03 => array( 61 | "string", 62 | ), 63 | 64 | 0x04 => array( 65 | "long", 66 | ), 67 | 68 | 0x05 => array( 69 | "int", 70 | "short", 71 | "slotData", 72 | ), 73 | 74 | 0x06 => array( 75 | "int", 76 | "int", 77 | "int", 78 | ), 79 | 80 | 0x07 => array( 81 | "int", 82 | "int", 83 | "bool", 84 | ), 85 | 86 | 0x08 => array( 87 | "short", 88 | "short", 89 | "float", 90 | ), 91 | 92 | 0x09 => array( 93 | "int", 94 | "byte", 95 | "byte", 96 | "short", 97 | "string", 98 | ), 99 | 100 | 0x0a => array( 101 | "bool", 102 | ), 103 | 104 | 0x0b => array( 105 | "double", 106 | "double", 107 | "double", 108 | "double", 109 | "bool", 110 | ), 111 | 112 | 0x0c => array( 113 | "float", 114 | "float", 115 | "bool", 116 | ), 117 | 118 | 0x0d => array( 119 | "double", 120 | "double", 121 | "double", 122 | "double", 123 | "float", 124 | "float", 125 | "bool", 126 | ), 127 | 128 | 0x0e => array( 129 | "byte", 130 | "int", 131 | "byte", 132 | "int", 133 | "byte", 134 | ), 135 | 136 | 0x0f => array( 137 | "int", 138 | "ubyte", 139 | "int", 140 | "byte", 141 | "slotData", 142 | "byte", 143 | "byte", 144 | "byte", 145 | ), 146 | 147 | 0x10 => array( 148 | "short", 149 | ), 150 | 151 | 0x11 => array( 152 | "int", 153 | "byte", 154 | "int", 155 | "byte", 156 | "int", 157 | ), 158 | 159 | 0x12 => array( 160 | "int", 161 | "byte", 162 | ), 163 | 164 | 0x13 => array( 165 | "int", 166 | "byte", 167 | ), 168 | 169 | 0x14 => array( 170 | "int", 171 | "string", 172 | "int", 173 | "int", 174 | "int", 175 | "byte", 176 | "byte", 177 | "short", 178 | "entityMetadata", 179 | ), 180 | 181 | 0x15 => array( 182 | "int", 183 | "short", 184 | "byte", 185 | "short", 186 | "int", 187 | "int", 188 | "int", 189 | "byte", 190 | "byte", 191 | "byte", 192 | ), 193 | 194 | 0x16 => array( 195 | "int", 196 | "int", 197 | ), 198 | 199 | 0x17 => array( 200 | "int", 201 | "byte", 202 | "int", 203 | "int", 204 | "int", 205 | "int", //if >0, fireball 206 | "short", 207 | "short", 208 | "short", 209 | ), 210 | 211 | 0x18 => array( 212 | "int", 213 | "byte", 214 | "int", 215 | "int", 216 | "int", 217 | "byte", 218 | "byte", 219 | "byte", 220 | "short", 221 | "short", 222 | "short", 223 | "entityMetadata", 224 | ), 225 | 226 | 0x19 => array( 227 | "int", 228 | "string", 229 | "int", 230 | "int", 231 | "int", 232 | "int", 233 | ), 234 | 235 | 0x1a => array( 236 | "int", 237 | "int", 238 | "int", 239 | "int", 240 | "short", 241 | ), 242 | 243 | 0x1c => array( 244 | "int", 245 | "short", 246 | "short", 247 | "short", 248 | ), 249 | 250 | 0x1d => array( 251 | "byte", 252 | "intArray", 253 | ), 254 | 255 | 0x1e => array( 256 | "int", 257 | ), 258 | 259 | 0x1f => array( 260 | "int", 261 | "byte", 262 | "byte", 263 | "byte", 264 | ), 265 | 266 | 0x20 => array( 267 | "int", 268 | "byte", 269 | "byte", 270 | ), 271 | 272 | 0x21 => array( 273 | "int", 274 | "byte", 275 | "byte", 276 | "byte", 277 | "byte", 278 | "byte", 279 | ), 280 | 281 | 0x22 => array( 282 | "int", 283 | "int", 284 | "int", 285 | "int", 286 | "byte", 287 | "byte", 288 | ), 289 | 290 | 0x23 => array( 291 | "int", 292 | "byte", 293 | ), 294 | 295 | 0x26 => array( 296 | "int", 297 | "byte", 298 | ), 299 | 300 | 0x27 => array( 301 | "int", 302 | "int", 303 | ), 304 | 305 | 0x28 => array( 306 | "int", 307 | "entityMetadata", 308 | ), 309 | 310 | 0x29 => array( 311 | "int", 312 | "byte", 313 | "byte", 314 | "short", 315 | ), 316 | 317 | 0x2a => array( 318 | "int", 319 | "byte", 320 | ), 321 | 322 | 0x2b => array( 323 | "float", 324 | "short", 325 | "short", 326 | ), 327 | 328 | 0x33 => array( 329 | "int", 330 | "int", 331 | "bool", 332 | "ushort", 333 | "ushort", 334 | "int", 335 | "byteArray", 336 | ), 337 | 338 | 0x34 => array( 339 | "int", 340 | "int", 341 | "short", 342 | "int", 343 | "newMultiblockArray", 344 | ), 345 | 346 | 0x35 => array( 347 | "int", 348 | "byte", 349 | "int", 350 | "short", 351 | "byte", 352 | ), 353 | 354 | 0x36 => array( 355 | "int", 356 | "short", 357 | "int", 358 | "byte", 359 | "byte", 360 | "byte", 361 | ), 362 | 363 | 0x37 => array( 364 | "int", 365 | "int", 366 | "int", 367 | "int", 368 | "byte", 369 | ), 370 | 371 | 0x38 => array( 372 | "short", 373 | "int", 374 | "byteArray", 375 | "chunkInfo", 376 | ), 377 | 378 | 0x3c => array( 379 | "double", 380 | "double", 381 | "double", 382 | "float", 383 | "int", 384 | "explosionRecord", 385 | "float", 386 | "float", 387 | "float", 388 | ), 389 | 390 | 0x3d => array( 391 | "int", 392 | "int", 393 | "byte", 394 | "int", 395 | "int", 396 | ), 397 | 398 | 0x3e => array( 399 | "string", 400 | "int", 401 | "int", 402 | "int", 403 | "float", 404 | "byte", 405 | ), 406 | 407 | 0x46 => array( 408 | "byte", 409 | "byte", 410 | ), 411 | 412 | 0x47 => array( 413 | "int", 414 | "bool", 415 | "int", 416 | "int", 417 | "int", 418 | ), 419 | 420 | 0x64 => array( 421 | "byte", 422 | "byte", 423 | "string", 424 | "byte", 425 | ), 426 | 427 | 0x65 => array( 428 | "byte", 429 | ), 430 | 431 | 0x66 => array( 432 | "byte", 433 | "short", 434 | "byte", 435 | "short", 436 | "bool", 437 | "slotData", 438 | ), 439 | 440 | 0x67 => array( 441 | "byte", 442 | "short", 443 | "slotData", 444 | ), 445 | 446 | 0x68 => array( 447 | "byte", 448 | "short", 449 | "slotArray", 450 | ), 451 | 452 | 0x69 => array( 453 | "byte", 454 | "short", 455 | "short", 456 | ), 457 | 458 | 0x6a => array( 459 | "byte", 460 | "short", 461 | "bool", 462 | ), 463 | 464 | 0x6b => array( 465 | "short", 466 | "slotData", 467 | ), 468 | 469 | 0x6c => array( 470 | "byte", 471 | "byte", 472 | ), 473 | 474 | 0x82 => array( 475 | "int", 476 | "short", 477 | "int", 478 | "string", 479 | "string", 480 | "string", 481 | "string", 482 | ), 483 | 484 | 0x83 => array( 485 | "short", 486 | "short", 487 | "ubyte", 488 | "byteArray", 489 | ), 490 | 491 | 0x84 => array( 492 | "int", 493 | "short", 494 | "int", 495 | "byte", 496 | "int", 497 | "int", 498 | "int", 499 | ), 500 | 501 | 0xc8 => array( 502 | "int", 503 | "byte", 504 | ), 505 | 506 | 0xc9 => array( 507 | "string", 508 | "byte", 509 | "short", 510 | ), 511 | 512 | 0xca => array( 513 | "byte", 514 | "byte", 515 | "byte", 516 | ), 517 | 518 | 0xcb => array( 519 | "string", 520 | ), 521 | 522 | 0xcc => array( 523 | "string", 524 | ), 525 | 526 | 0xcd => array( 527 | "byte", 528 | ), 529 | 530 | 0xfa => array( 531 | "string", 532 | "short", 533 | "byteArray", 534 | ), 535 | 536 | 0xfc => array( 537 | "short", 538 | "byteArray", 539 | "short", 540 | "byteArray", 541 | ), 542 | 543 | 0xfd => array( 544 | "string", 545 | "short", 546 | "byteArray", 547 | "short", 548 | "byteArray", 549 | ), 550 | 551 | 0xfe => array( 552 | ), 553 | 554 | 0xff => array( 555 | "string", 556 | ), 557 | 558 | ); 559 | 560 | 561 | ?> -------------------------------------------------------------------------------- /pstruct/41.php: -------------------------------------------------------------------------------- 1 | array( 40 | "int", 41 | ), 42 | 43 | 0x01 => array( 44 | "int", 45 | "string", 46 | "byte", 47 | "byte", 48 | "byte", 49 | "ubyte", 50 | "ubyte", 51 | ), 52 | 53 | 0x02 => array( 54 | "byte", 55 | "string", 56 | "string", 57 | "int", 58 | ), 59 | 60 | 0x03 => array( 61 | "string", 62 | ), 63 | 64 | 0x04 => array( 65 | "long", 66 | "long", 67 | ), 68 | 69 | 0x05 => array( 70 | "int", 71 | "short", 72 | "slotData", 73 | ), 74 | 75 | 0x06 => array( 76 | "int", 77 | "int", 78 | "int", 79 | ), 80 | 81 | 0x07 => array( 82 | "int", 83 | "int", 84 | "bool", 85 | ), 86 | 87 | 0x08 => array( 88 | "short", 89 | "short", 90 | "float", 91 | ), 92 | 93 | 0x09 => array( 94 | "int", 95 | "byte", 96 | "byte", 97 | "short", 98 | "string", 99 | ), 100 | 101 | 0x0a => array( 102 | "bool", 103 | ), 104 | 105 | 0x0b => array( 106 | "double", 107 | "double", 108 | "double", 109 | "double", 110 | "bool", 111 | ), 112 | 113 | 0x0c => array( 114 | "float", 115 | "float", 116 | "bool", 117 | ), 118 | 119 | 0x0d => array( 120 | "double", 121 | "double", 122 | "double", 123 | "double", 124 | "float", 125 | "float", 126 | "bool", 127 | ), 128 | 129 | 0x0e => array( 130 | "byte", 131 | "int", 132 | "byte", 133 | "int", 134 | "byte", 135 | ), 136 | 137 | 0x0f => array( 138 | "int", 139 | "ubyte", 140 | "int", 141 | "byte", 142 | "slotData", 143 | "byte", 144 | "byte", 145 | "byte", 146 | ), 147 | 148 | 0x10 => array( 149 | "short", 150 | ), 151 | 152 | 0x11 => array( 153 | "int", 154 | "byte", 155 | "int", 156 | "byte", 157 | "int", 158 | ), 159 | 160 | 0x12 => array( 161 | "int", 162 | "byte", 163 | ), 164 | 165 | 0x13 => array( 166 | "int", 167 | "byte", 168 | ), 169 | 170 | 0x14 => array( 171 | "int", 172 | "string", 173 | "int", 174 | "int", 175 | "int", 176 | "byte", 177 | "byte", 178 | "short", 179 | "entityMetadata", 180 | ), 181 | 182 | 0x15 => array( 183 | "int", 184 | "dropArray", 185 | "int", 186 | "int", 187 | "int", 188 | "byte", 189 | "byte", 190 | "byte", 191 | ), 192 | 193 | 0x16 => array( 194 | "int", 195 | "int", 196 | ), 197 | 198 | 0x17 => array( 199 | "int", 200 | "byte", 201 | "int", 202 | "int", 203 | "int", 204 | "int", //if >0, fireball 205 | "short", 206 | "short", 207 | "short", 208 | ), 209 | 210 | 0x18 => array( 211 | "int", 212 | "byte", 213 | "int", 214 | "int", 215 | "int", 216 | "byte", 217 | "byte", 218 | "byte", 219 | "short", 220 | "short", 221 | "short", 222 | "entityMetadata", 223 | ), 224 | 225 | 0x19 => array( 226 | "int", 227 | "string", 228 | "int", 229 | "int", 230 | "int", 231 | "int", 232 | ), 233 | 234 | 0x1a => array( 235 | "int", 236 | "int", 237 | "int", 238 | "int", 239 | "short", 240 | ), 241 | 242 | 0x1c => array( 243 | "int", 244 | "short", 245 | "short", 246 | "short", 247 | ), 248 | 249 | 0x1d => array( 250 | "byte", 251 | "intArray", 252 | ), 253 | 254 | 0x1e => array( 255 | "int", 256 | ), 257 | 258 | 0x1f => array( 259 | "int", 260 | "byte", 261 | "byte", 262 | "byte", 263 | ), 264 | 265 | 0x20 => array( 266 | "int", 267 | "byte", 268 | "byte", 269 | ), 270 | 271 | 0x21 => array( 272 | "int", 273 | "byte", 274 | "byte", 275 | "byte", 276 | "byte", 277 | "byte", 278 | ), 279 | 280 | 0x22 => array( 281 | "int", 282 | "int", 283 | "int", 284 | "int", 285 | "byte", 286 | "byte", 287 | ), 288 | 289 | 0x23 => array( 290 | "int", 291 | "byte", 292 | ), 293 | 294 | 0x26 => array( 295 | "int", 296 | "byte", 297 | ), 298 | 299 | 0x27 => array( 300 | "int", 301 | "int", 302 | ), 303 | 304 | 0x28 => array( 305 | "int", 306 | "entityMetadata", 307 | ), 308 | 309 | 0x29 => array( 310 | "int", 311 | "byte", 312 | "byte", 313 | "short", 314 | ), 315 | 316 | 0x2a => array( 317 | "int", 318 | "byte", 319 | ), 320 | 321 | 0x2b => array( 322 | "float", 323 | "short", 324 | "short", 325 | ), 326 | 327 | 0x33 => array( 328 | "int", 329 | "int", 330 | "bool", 331 | "ushort", 332 | "ushort", 333 | "int", 334 | "byteArray", 335 | ), 336 | 337 | 0x34 => array( 338 | "int", 339 | "int", 340 | "short", 341 | "int", 342 | "newMultiblockArray", 343 | ), 344 | 345 | 0x35 => array( 346 | "int", 347 | "byte", 348 | "int", 349 | "short", 350 | "byte", 351 | ), 352 | 353 | 0x36 => array( 354 | "int", 355 | "short", 356 | "int", 357 | "byte", 358 | "byte", 359 | "short", 360 | ), 361 | 362 | 0x37 => array( 363 | "int", 364 | "int", 365 | "int", 366 | "int", 367 | "byte", 368 | ), 369 | 370 | 0x38 => array( 371 | "short", 372 | "int", 373 | "byteArray", 374 | "chunkInfo", 375 | ), 376 | 377 | 0x3c => array( 378 | "double", 379 | "double", 380 | "double", 381 | "float", 382 | "int", 383 | "explosionRecord", 384 | "float", 385 | "float", 386 | "float", 387 | ), 388 | 389 | 0x3d => array( 390 | "int", 391 | "int", 392 | "byte", 393 | "int", 394 | "int", 395 | ), 396 | 397 | 0x3e => array( 398 | "string", 399 | "int", 400 | "int", 401 | "int", 402 | "float", 403 | "byte", 404 | ), 405 | 406 | 0x46 => array( 407 | "byte", 408 | "byte", 409 | ), 410 | 411 | 0x47 => array( 412 | "int", 413 | "bool", 414 | "int", 415 | "int", 416 | "int", 417 | ), 418 | 419 | 0x64 => array( 420 | "byte", 421 | "byte", 422 | "string", 423 | "byte", 424 | ), 425 | 426 | 0x65 => array( 427 | "byte", 428 | ), 429 | 430 | 0x66 => array( 431 | "byte", 432 | "short", 433 | "byte", 434 | "short", 435 | "bool", 436 | "slotData", 437 | ), 438 | 439 | 0x67 => array( 440 | "byte", 441 | "short", 442 | "slotData", 443 | ), 444 | 445 | 0x68 => array( 446 | "byte", 447 | "short", 448 | "slotArray", 449 | ), 450 | 451 | 0x69 => array( 452 | "byte", 453 | "short", 454 | "short", 455 | ), 456 | 457 | 0x6a => array( 458 | "byte", 459 | "short", 460 | "bool", 461 | ), 462 | 463 | 0x6b => array( 464 | "short", 465 | "slotData", 466 | ), 467 | 468 | 0x6c => array( 469 | "byte", 470 | "byte", 471 | ), 472 | 473 | 0x82 => array( 474 | "int", 475 | "short", 476 | "int", 477 | "string", 478 | "string", 479 | "string", 480 | "string", 481 | ), 482 | 483 | 0x83 => array( 484 | "short", 485 | "short", 486 | "ubyte", 487 | "byteArray", 488 | ), 489 | 490 | 0x84 => array( 491 | "int", 492 | "short", 493 | "int", 494 | "byte", 495 | "short", 496 | "byteArray", 497 | ), 498 | 499 | 0xc8 => array( 500 | "int", 501 | "byte", 502 | ), 503 | 504 | 0xc9 => array( 505 | "string", 506 | "byte", 507 | "short", 508 | ), 509 | 510 | 0xca => array( 511 | "byte", 512 | "byte", 513 | "byte", 514 | ), 515 | 516 | 0xcb => array( 517 | "string", 518 | ), 519 | 520 | 0xcc => array( 521 | "string", 522 | "byte", 523 | "byte", 524 | "byte", 525 | ), 526 | 527 | 0xcd => array( 528 | "byte", 529 | ), 530 | 531 | 0xfa => array( 532 | "string", 533 | "short", 534 | "byteArray", 535 | ), 536 | 537 | 0xfc => array( 538 | "short", 539 | "byteArray", 540 | "short", 541 | "byteArray", 542 | ), 543 | 544 | 0xfd => array( 545 | "string", 546 | "short", 547 | "byteArray", 548 | "short", 549 | "byteArray", 550 | ), 551 | 552 | 0xfe => array( 553 | ), 554 | 555 | 0xff => array( 556 | "string", 557 | ), 558 | 559 | ); 560 | 561 | 562 | ?> -------------------------------------------------------------------------------- /pstruct/42.php: -------------------------------------------------------------------------------- 1 | array( 40 | "int", 41 | ), 42 | 43 | 0x01 => array( 44 | "int", 45 | "string", 46 | "byte", 47 | "byte", 48 | "byte", 49 | "ubyte", 50 | "ubyte", 51 | ), 52 | 53 | 0x02 => array( 54 | "byte", 55 | "string", 56 | "string", 57 | "int", 58 | ), 59 | 60 | 0x03 => array( 61 | "string", 62 | ), 63 | 64 | 0x04 => array( 65 | "long", 66 | "long", 67 | ), 68 | 69 | 0x05 => array( 70 | "int", 71 | "short", 72 | "slotData", 73 | ), 74 | 75 | 0x06 => array( 76 | "int", 77 | "int", 78 | "int", 79 | ), 80 | 81 | 0x07 => array( 82 | "int", 83 | "int", 84 | "bool", 85 | ), 86 | 87 | 0x08 => array( 88 | "short", 89 | "short", 90 | "float", 91 | ), 92 | 93 | 0x09 => array( 94 | "int", 95 | "byte", 96 | "byte", 97 | "short", 98 | "string", 99 | ), 100 | 101 | 0x0a => array( 102 | "bool", 103 | ), 104 | 105 | 0x0b => array( 106 | "double", 107 | "double", 108 | "double", 109 | "double", 110 | "bool", 111 | ), 112 | 113 | 0x0c => array( 114 | "float", 115 | "float", 116 | "bool", 117 | ), 118 | 119 | 0x0d => array( 120 | "double", 121 | "double", 122 | "double", 123 | "double", 124 | "float", 125 | "float", 126 | "bool", 127 | ), 128 | 129 | 0x0e => array( 130 | "byte", 131 | "int", 132 | "byte", 133 | "int", 134 | "byte", 135 | ), 136 | 137 | 0x0f => array( 138 | "int", 139 | "ubyte", 140 | "int", 141 | "byte", 142 | "slotData", 143 | "byte", 144 | "byte", 145 | "byte", 146 | ), 147 | 148 | 0x10 => array( 149 | "short", 150 | ), 151 | 152 | 0x11 => array( 153 | "int", 154 | "byte", 155 | "int", 156 | "byte", 157 | "int", 158 | ), 159 | 160 | 0x12 => array( 161 | "int", 162 | "byte", 163 | ), 164 | 165 | 0x13 => array( 166 | "int", 167 | "byte", 168 | ), 169 | 170 | 0x14 => array( 171 | "int", 172 | "string", 173 | "int", 174 | "int", 175 | "int", 176 | "byte", 177 | "byte", 178 | "short", 179 | "entityMetadata", 180 | ), 181 | 182 | 0x15 => array( 183 | "int", 184 | "dropArray", 185 | "int", 186 | "int", 187 | "int", 188 | "byte", 189 | "byte", 190 | "byte", 191 | ), 192 | 193 | 0x16 => array( 194 | "int", 195 | "int", 196 | ), 197 | 198 | 0x17 => array( 199 | "int", 200 | "byte", 201 | "int", 202 | "int", 203 | "int", 204 | "int", //if >0, fireball 205 | "short", 206 | "short", 207 | "short", 208 | ), 209 | 210 | 0x18 => array( 211 | "int", 212 | "byte", 213 | "int", 214 | "int", 215 | "int", 216 | "byte", 217 | "byte", 218 | "byte", 219 | "short", 220 | "short", 221 | "short", 222 | "entityMetadata", 223 | ), 224 | 225 | 0x19 => array( 226 | "int", 227 | "string", 228 | "int", 229 | "int", 230 | "int", 231 | "int", 232 | ), 233 | 234 | 0x1a => array( 235 | "int", 236 | "int", 237 | "int", 238 | "int", 239 | "short", 240 | ), 241 | 242 | 0x1c => array( 243 | "int", 244 | "short", 245 | "short", 246 | "short", 247 | ), 248 | 249 | 0x1d => array( 250 | "byte", 251 | "intArray", 252 | ), 253 | 254 | 0x1e => array( 255 | "int", 256 | ), 257 | 258 | 0x1f => array( 259 | "int", 260 | "byte", 261 | "byte", 262 | "byte", 263 | ), 264 | 265 | 0x20 => array( 266 | "int", 267 | "byte", 268 | "byte", 269 | ), 270 | 271 | 0x21 => array( 272 | "int", 273 | "byte", 274 | "byte", 275 | "byte", 276 | "byte", 277 | "byte", 278 | ), 279 | 280 | 0x22 => array( 281 | "int", 282 | "int", 283 | "int", 284 | "int", 285 | "byte", 286 | "byte", 287 | ), 288 | 289 | 0x23 => array( 290 | "int", 291 | "byte", 292 | ), 293 | 294 | 0x26 => array( 295 | "int", 296 | "byte", 297 | ), 298 | 299 | 0x27 => array( 300 | "int", 301 | "int", 302 | ), 303 | 304 | 0x28 => array( 305 | "int", 306 | "entityMetadata", 307 | ), 308 | 309 | 0x29 => array( 310 | "int", 311 | "byte", 312 | "byte", 313 | "short", 314 | ), 315 | 316 | 0x2a => array( 317 | "int", 318 | "byte", 319 | ), 320 | 321 | 0x2b => array( 322 | "float", 323 | "short", 324 | "short", 325 | ), 326 | 327 | 0x33 => array( 328 | "int", 329 | "int", 330 | "bool", 331 | "ushort", 332 | "ushort", 333 | "int", 334 | "byteArray", 335 | ), 336 | 337 | 0x34 => array( 338 | "int", 339 | "int", 340 | "short", 341 | "int", 342 | "newMultiblockArray", 343 | ), 344 | 345 | 0x35 => array( 346 | "int", 347 | "byte", 348 | "int", 349 | "short", 350 | "byte", 351 | ), 352 | 353 | 0x36 => array( 354 | "int", 355 | "short", 356 | "int", 357 | "byte", 358 | "byte", 359 | "short", 360 | ), 361 | 362 | 0x37 => array( 363 | "int", 364 | "int", 365 | "int", 366 | "int", 367 | "byte", 368 | ), 369 | 370 | 0x38 => array( 371 | "short", 372 | "int", 373 | "byteArray", 374 | "chunkInfo", 375 | ), 376 | 377 | 0x3c => array( 378 | "double", 379 | "double", 380 | "double", 381 | "float", 382 | "int", 383 | "explosionRecord", 384 | "float", 385 | "float", 386 | "float", 387 | ), 388 | 389 | 0x3d => array( 390 | "int", 391 | "int", 392 | "byte", 393 | "int", 394 | "int", 395 | ), 396 | 397 | 0x3e => array( 398 | "string", 399 | "int", 400 | "int", 401 | "int", 402 | "float", 403 | "byte", 404 | ), 405 | 406 | 0x46 => array( 407 | "byte", 408 | "byte", 409 | ), 410 | 411 | 0x47 => array( 412 | "int", 413 | "bool", 414 | "int", 415 | "int", 416 | "int", 417 | ), 418 | 419 | 0x64 => array( 420 | "byte", 421 | "byte", 422 | "string", 423 | "byte", 424 | ), 425 | 426 | 0x65 => array( 427 | "byte", 428 | ), 429 | 430 | 0x66 => array( 431 | "byte", 432 | "short", 433 | "byte", 434 | "short", 435 | "bool", 436 | "slotData", 437 | ), 438 | 439 | 0x67 => array( 440 | "byte", 441 | "short", 442 | "slotData", 443 | ), 444 | 445 | 0x68 => array( 446 | "byte", 447 | "short", 448 | "slotArray", 449 | ), 450 | 451 | 0x69 => array( 452 | "byte", 453 | "short", 454 | "short", 455 | ), 456 | 457 | 0x6a => array( 458 | "byte", 459 | "short", 460 | "bool", 461 | ), 462 | 463 | 0x6b => array( 464 | "short", 465 | "slotData", 466 | ), 467 | 468 | 0x6c => array( 469 | "byte", 470 | "byte", 471 | ), 472 | 473 | 0x82 => array( 474 | "int", 475 | "short", 476 | "int", 477 | "string", 478 | "string", 479 | "string", 480 | "string", 481 | ), 482 | 483 | 0x83 => array( 484 | "short", 485 | "short", 486 | "ubyte", 487 | "byteArray", 488 | ), 489 | 490 | 0x84 => array( 491 | "int", 492 | "short", 493 | "int", 494 | "byte", 495 | "short", 496 | "byteArray", 497 | ), 498 | 499 | 0xc8 => array( 500 | "int", 501 | "byte", 502 | ), 503 | 504 | 0xc9 => array( 505 | "string", 506 | "byte", 507 | "short", 508 | ), 509 | 510 | 0xca => array( 511 | "byte", 512 | "byte", 513 | "byte", 514 | ), 515 | 516 | 0xcb => array( 517 | "string", 518 | ), 519 | 520 | 0xcc => array( 521 | "string", 522 | "byte", 523 | "byte", 524 | "byte", 525 | ), 526 | 527 | 0xcd => array( 528 | "byte", 529 | ), 530 | 531 | 0xfa => array( 532 | "string", 533 | "short", 534 | "byteArray", 535 | ), 536 | 537 | 0xfc => array( 538 | "short", 539 | "byteArray", 540 | "short", 541 | "byteArray", 542 | ), 543 | 544 | 0xfd => array( 545 | "string", 546 | "short", 547 | "byteArray", 548 | "short", 549 | "byteArray", 550 | ), 551 | 552 | 0xfe => array( 553 | ), 554 | 555 | 0xff => array( 556 | "string", 557 | ), 558 | 559 | ); 560 | 561 | 562 | ?> -------------------------------------------------------------------------------- /pstruct/43.php: -------------------------------------------------------------------------------- 1 | array( 40 | "int", 41 | ), 42 | 43 | 0x01 => array( 44 | "int", 45 | "string", 46 | "byte", 47 | "byte", 48 | "byte", 49 | "ubyte", 50 | "ubyte", 51 | ), 52 | 53 | 0x02 => array( 54 | "byte", 55 | "string", 56 | "string", 57 | "int", 58 | ), 59 | 60 | 0x03 => array( 61 | "string", 62 | ), 63 | 64 | 0x04 => array( 65 | "long", 66 | "long", 67 | ), 68 | 69 | 0x05 => array( 70 | "int", 71 | "short", 72 | "slotData", 73 | ), 74 | 75 | 0x06 => array( 76 | "int", 77 | "int", 78 | "int", 79 | ), 80 | 81 | 0x07 => array( 82 | "int", 83 | "int", 84 | "bool", 85 | ), 86 | 87 | 0x08 => array( 88 | "short", 89 | "short", 90 | "float", 91 | ), 92 | 93 | 0x09 => array( 94 | "int", 95 | "byte", 96 | "byte", 97 | "short", 98 | "string", 99 | ), 100 | 101 | 0x0a => array( 102 | "bool", 103 | ), 104 | 105 | 0x0b => array( 106 | "double", 107 | "double", 108 | "double", 109 | "double", 110 | "bool", 111 | ), 112 | 113 | 0x0c => array( 114 | "float", 115 | "float", 116 | "bool", 117 | ), 118 | 119 | 0x0d => array( 120 | "double", 121 | "double", 122 | "double", 123 | "double", 124 | "float", 125 | "float", 126 | "bool", 127 | ), 128 | 129 | 0x0e => array( 130 | "byte", 131 | "int", 132 | "byte", 133 | "int", 134 | "byte", 135 | ), 136 | 137 | 0x0f => array( 138 | "int", 139 | "ubyte", 140 | "int", 141 | "byte", 142 | "slotData", 143 | "byte", 144 | "byte", 145 | "byte", 146 | ), 147 | 148 | 0x10 => array( 149 | "short", 150 | ), 151 | 152 | 0x11 => array( 153 | "int", 154 | "byte", 155 | "int", 156 | "byte", 157 | "int", 158 | ), 159 | 160 | 0x12 => array( 161 | "int", 162 | "byte", 163 | ), 164 | 165 | 0x13 => array( 166 | "int", 167 | "byte", 168 | ), 169 | 170 | 0x14 => array( 171 | "int", 172 | "string", 173 | "int", 174 | "int", 175 | "int", 176 | "byte", 177 | "byte", 178 | "short", 179 | "entityMetadata", 180 | ), 181 | 182 | 0x15 => array( 183 | "int", 184 | "dropArray", 185 | "int", 186 | "int", 187 | "int", 188 | "byte", 189 | "byte", 190 | "byte", 191 | ), 192 | 193 | 0x16 => array( 194 | "int", 195 | "int", 196 | ), 197 | 198 | 0x17 => array( 199 | "int", 200 | "byte", 201 | "int", 202 | "int", 203 | "int", 204 | "int", //if >0, fireball 205 | "short", 206 | "short", 207 | "short", 208 | ), 209 | 210 | 0x18 => array( 211 | "int", 212 | "byte", 213 | "int", 214 | "int", 215 | "int", 216 | "byte", 217 | "byte", 218 | "byte", 219 | "short", 220 | "short", 221 | "short", 222 | "entityMetadata", 223 | ), 224 | 225 | 0x19 => array( 226 | "int", 227 | "string", 228 | "int", 229 | "int", 230 | "int", 231 | "int", 232 | ), 233 | 234 | 0x1a => array( 235 | "int", 236 | "int", 237 | "int", 238 | "int", 239 | "short", 240 | ), 241 | 242 | 0x1c => array( 243 | "int", 244 | "short", 245 | "short", 246 | "short", 247 | ), 248 | 249 | 0x1d => array( 250 | "byte", 251 | "intArray", 252 | ), 253 | 254 | 0x1e => array( 255 | "int", 256 | ), 257 | 258 | 0x1f => array( 259 | "int", 260 | "byte", 261 | "byte", 262 | "byte", 263 | ), 264 | 265 | 0x20 => array( 266 | "int", 267 | "byte", 268 | "byte", 269 | ), 270 | 271 | 0x21 => array( 272 | "int", 273 | "byte", 274 | "byte", 275 | "byte", 276 | "byte", 277 | "byte", 278 | ), 279 | 280 | 0x22 => array( 281 | "int", 282 | "int", 283 | "int", 284 | "int", 285 | "byte", 286 | "byte", 287 | ), 288 | 289 | 0x23 => array( 290 | "int", 291 | "byte", 292 | ), 293 | 294 | 0x26 => array( 295 | "int", 296 | "byte", 297 | ), 298 | 299 | 0x27 => array( 300 | "int", 301 | "int", 302 | ), 303 | 304 | 0x28 => array( 305 | "int", 306 | "entityMetadata", 307 | ), 308 | 309 | 0x29 => array( 310 | "int", 311 | "byte", 312 | "byte", 313 | "short", 314 | ), 315 | 316 | 0x2a => array( 317 | "int", 318 | "byte", 319 | ), 320 | 321 | 0x2b => array( 322 | "float", 323 | "short", 324 | "short", 325 | ), 326 | 327 | 0x33 => array( 328 | "int", 329 | "int", 330 | "bool", 331 | "ushort", 332 | "ushort", 333 | "int", 334 | "byteArray", 335 | ), 336 | 337 | 0x34 => array( 338 | "int", 339 | "int", 340 | "short", 341 | "int", 342 | "newMultiblockArray", 343 | ), 344 | 345 | 0x35 => array( 346 | "int", 347 | "byte", 348 | "int", 349 | "short", 350 | "byte", 351 | ), 352 | 353 | 0x36 => array( 354 | "int", 355 | "short", 356 | "int", 357 | "byte", 358 | "byte", 359 | "short", 360 | ), 361 | 362 | 0x37 => array( 363 | "int", 364 | "int", 365 | "int", 366 | "int", 367 | "byte", 368 | ), 369 | 370 | 0x38 => array( 371 | "short", 372 | "int", 373 | "byteArray", 374 | "chunkInfo", 375 | ), 376 | 377 | 0x3c => array( 378 | "double", 379 | "double", 380 | "double", 381 | "float", 382 | "int", 383 | "explosionRecord", 384 | "float", 385 | "float", 386 | "float", 387 | ), 388 | 389 | 0x3d => array( 390 | "int", 391 | "int", 392 | "byte", 393 | "int", 394 | "int", 395 | ), 396 | 397 | 0x3e => array( 398 | "string", 399 | "int", 400 | "int", 401 | "int", 402 | "float", 403 | "byte", 404 | ), 405 | 406 | 0x46 => array( 407 | "byte", 408 | "byte", 409 | ), 410 | 411 | 0x47 => array( 412 | "int", 413 | "bool", 414 | "int", 415 | "int", 416 | "int", 417 | ), 418 | 419 | 0x64 => array( 420 | "byte", 421 | "byte", 422 | "string", 423 | "byte", 424 | ), 425 | 426 | 0x65 => array( 427 | "byte", 428 | ), 429 | 430 | 0x66 => array( 431 | "byte", 432 | "short", 433 | "byte", 434 | "short", 435 | "bool", 436 | "slotData", 437 | ), 438 | 439 | 0x67 => array( 440 | "byte", 441 | "short", 442 | "slotData", 443 | ), 444 | 445 | 0x68 => array( 446 | "byte", 447 | "short", 448 | "slotArray", 449 | ), 450 | 451 | 0x69 => array( 452 | "byte", 453 | "short", 454 | "short", 455 | ), 456 | 457 | 0x6a => array( 458 | "byte", 459 | "short", 460 | "bool", 461 | ), 462 | 463 | 0x6b => array( 464 | "short", 465 | "slotData", 466 | ), 467 | 468 | 0x6c => array( 469 | "byte", 470 | "byte", 471 | ), 472 | 473 | 0x82 => array( 474 | "int", 475 | "short", 476 | "int", 477 | "string", 478 | "string", 479 | "string", 480 | "string", 481 | ), 482 | 483 | 0x83 => array( 484 | "short", 485 | "short", 486 | "ubyte", 487 | "byteArray", 488 | ), 489 | 490 | 0x84 => array( 491 | "int", 492 | "short", 493 | "int", 494 | "byte", 495 | "short", 496 | "byteArray", 497 | ), 498 | 499 | 0xc8 => array( 500 | "int", 501 | "byte", 502 | ), 503 | 504 | 0xc9 => array( 505 | "string", 506 | "byte", 507 | "short", 508 | ), 509 | 510 | 0xca => array( 511 | "byte", 512 | "byte", 513 | "byte", 514 | ), 515 | 516 | 0xcb => array( 517 | "string", 518 | ), 519 | 520 | 0xcc => array( 521 | "string", 522 | "byte", 523 | "byte", 524 | "byte", 525 | ), 526 | 527 | 0xcd => array( 528 | "byte", 529 | ), 530 | 531 | 0xfa => array( 532 | "string", 533 | "short", 534 | "byteArray", 535 | ), 536 | 537 | 0xfc => array( 538 | "short", 539 | "byteArray", 540 | "short", 541 | "byteArray", 542 | ), 543 | 544 | 0xfd => array( 545 | "string", 546 | "short", 547 | "byteArray", 548 | "short", 549 | "byteArray", 550 | ), 551 | 552 | 0xfe => array( 553 | ), 554 | 555 | 0xff => array( 556 | "string", 557 | ), 558 | 559 | ); 560 | 561 | 562 | ?> -------------------------------------------------------------------------------- /pstruct/44.php: -------------------------------------------------------------------------------- 1 | array( 40 | "int", 41 | ), 42 | 43 | 0x01 => array( 44 | "int", 45 | "string", 46 | "byte", 47 | "byte", 48 | "byte", 49 | "ubyte", 50 | "ubyte", 51 | ), 52 | 53 | 0x02 => array( 54 | "byte", 55 | "string", 56 | "string", 57 | "int", 58 | ), 59 | 60 | 0x03 => array( 61 | "string", 62 | ), 63 | 64 | 0x04 => array( 65 | "long", 66 | "long", 67 | ), 68 | 69 | 0x05 => array( 70 | "int", 71 | "short", 72 | "slotData", 73 | ), 74 | 75 | 0x06 => array( 76 | "int", 77 | "int", 78 | "int", 79 | ), 80 | 81 | 0x07 => array( 82 | "int", 83 | "int", 84 | "bool", 85 | ), 86 | 87 | 0x08 => array( 88 | "short", 89 | "short", 90 | "float", 91 | ), 92 | 93 | 0x09 => array( 94 | "int", 95 | "byte", 96 | "byte", 97 | "short", 98 | "string", 99 | ), 100 | 101 | 0x0a => array( 102 | "bool", 103 | ), 104 | 105 | 0x0b => array( 106 | "double", 107 | "double", 108 | "double", 109 | "double", 110 | "bool", 111 | ), 112 | 113 | 0x0c => array( 114 | "float", 115 | "float", 116 | "bool", 117 | ), 118 | 119 | 0x0d => array( 120 | "double", 121 | "double", 122 | "double", 123 | "double", 124 | "float", 125 | "float", 126 | "bool", 127 | ), 128 | 129 | 0x0e => array( 130 | "byte", 131 | "int", 132 | "byte", 133 | "int", 134 | "byte", 135 | ), 136 | 137 | 0x0f => array( 138 | "int", 139 | "ubyte", 140 | "int", 141 | "byte", 142 | "slotData", 143 | "byte", 144 | "byte", 145 | "byte", 146 | ), 147 | 148 | 0x10 => array( 149 | "short", 150 | ), 151 | 152 | 0x11 => array( 153 | "int", 154 | "byte", 155 | "int", 156 | "byte", 157 | "int", 158 | ), 159 | 160 | 0x12 => array( 161 | "int", 162 | "byte", 163 | ), 164 | 165 | 0x13 => array( 166 | "int", 167 | "byte", 168 | ), 169 | 170 | 0x14 => array( 171 | "int", 172 | "string", 173 | "int", 174 | "int", 175 | "int", 176 | "byte", 177 | "byte", 178 | "short", 179 | "entityMetadata", 180 | ), 181 | 182 | 0x15 => array( 183 | "int", 184 | "dropArray", 185 | "int", 186 | "int", 187 | "int", 188 | "byte", 189 | "byte", 190 | "byte", 191 | ), 192 | 193 | 0x16 => array( 194 | "int", 195 | "int", 196 | ), 197 | 198 | 0x17 => array( 199 | "int", 200 | "byte", 201 | "int", 202 | "int", 203 | "int", 204 | "int", //if >0, fireball 205 | "short", 206 | "short", 207 | "short", 208 | ), 209 | 210 | 0x18 => array( 211 | "int", 212 | "byte", 213 | "int", 214 | "int", 215 | "int", 216 | "byte", 217 | "byte", 218 | "byte", 219 | "short", 220 | "short", 221 | "short", 222 | "entityMetadata", 223 | ), 224 | 225 | 0x19 => array( 226 | "int", 227 | "string", 228 | "int", 229 | "int", 230 | "int", 231 | "int", 232 | ), 233 | 234 | 0x1a => array( 235 | "int", 236 | "int", 237 | "int", 238 | "int", 239 | "short", 240 | ), 241 | 242 | 0x1c => array( 243 | "int", 244 | "short", 245 | "short", 246 | "short", 247 | ), 248 | 249 | 0x1d => array( 250 | "byte", 251 | "intArray", 252 | ), 253 | 254 | 0x1e => array( 255 | "int", 256 | ), 257 | 258 | 0x1f => array( 259 | "int", 260 | "byte", 261 | "byte", 262 | "byte", 263 | ), 264 | 265 | 0x20 => array( 266 | "int", 267 | "byte", 268 | "byte", 269 | ), 270 | 271 | 0x21 => array( 272 | "int", 273 | "byte", 274 | "byte", 275 | "byte", 276 | "byte", 277 | "byte", 278 | ), 279 | 280 | 0x22 => array( 281 | "int", 282 | "int", 283 | "int", 284 | "int", 285 | "byte", 286 | "byte", 287 | ), 288 | 289 | 0x23 => array( 290 | "int", 291 | "byte", 292 | ), 293 | 294 | 0x26 => array( 295 | "int", 296 | "byte", 297 | ), 298 | 299 | 0x27 => array( 300 | "int", 301 | "int", 302 | ), 303 | 304 | 0x28 => array( 305 | "int", 306 | "entityMetadata", 307 | ), 308 | 309 | 0x29 => array( 310 | "int", 311 | "byte", 312 | "byte", 313 | "short", 314 | ), 315 | 316 | 0x2a => array( 317 | "int", 318 | "byte", 319 | ), 320 | 321 | 0x2b => array( 322 | "float", 323 | "short", 324 | "short", 325 | ), 326 | 327 | 0x33 => array( 328 | "int", 329 | "int", 330 | "bool", 331 | "ushort", 332 | "ushort", 333 | "int", 334 | "byteArray", 335 | ), 336 | 337 | 0x34 => array( 338 | "int", 339 | "int", 340 | "short", 341 | "int", 342 | "newMultiblockArray", 343 | ), 344 | 345 | 0x35 => array( 346 | "int", 347 | "byte", 348 | "int", 349 | "short", 350 | "byte", 351 | ), 352 | 353 | 0x36 => array( 354 | "int", 355 | "short", 356 | "int", 357 | "byte", 358 | "byte", 359 | "short", 360 | ), 361 | 362 | 0x37 => array( 363 | "int", 364 | "int", 365 | "int", 366 | "int", 367 | "byte", 368 | ), 369 | 370 | 0x38 => array( 371 | "short", 372 | "int", 373 | "byteArray", 374 | "chunkInfo", 375 | ), 376 | 377 | 0x3c => array( 378 | "double", 379 | "double", 380 | "double", 381 | "float", 382 | "int", 383 | "explosionRecord", 384 | "float", 385 | "float", 386 | "float", 387 | ), 388 | 389 | 0x3d => array( 390 | "int", 391 | "int", 392 | "byte", 393 | "int", 394 | "int", 395 | ), 396 | 397 | 0x3e => array( 398 | "string", 399 | "int", 400 | "int", 401 | "int", 402 | "float", 403 | "byte", 404 | ), 405 | 406 | 0x46 => array( 407 | "byte", 408 | "byte", 409 | ), 410 | 411 | 0x47 => array( 412 | "int", 413 | "bool", 414 | "int", 415 | "int", 416 | "int", 417 | ), 418 | 419 | 0x64 => array( 420 | "byte", 421 | "byte", 422 | "string", 423 | "byte", 424 | ), 425 | 426 | 0x65 => array( 427 | "byte", 428 | ), 429 | 430 | 0x66 => array( 431 | "byte", 432 | "short", 433 | "byte", 434 | "short", 435 | "bool", 436 | "slotData", 437 | ), 438 | 439 | 0x67 => array( 440 | "byte", 441 | "short", 442 | "slotData", 443 | ), 444 | 445 | 0x68 => array( 446 | "byte", 447 | "short", 448 | "slotArray", 449 | ), 450 | 451 | 0x69 => array( 452 | "byte", 453 | "short", 454 | "short", 455 | ), 456 | 457 | 0x6a => array( 458 | "byte", 459 | "short", 460 | "bool", 461 | ), 462 | 463 | 0x6b => array( 464 | "short", 465 | "slotData", 466 | ), 467 | 468 | 0x6c => array( 469 | "byte", 470 | "byte", 471 | ), 472 | 473 | 0x82 => array( 474 | "int", 475 | "short", 476 | "int", 477 | "string", 478 | "string", 479 | "string", 480 | "string", 481 | ), 482 | 483 | 0x83 => array( 484 | "short", 485 | "short", 486 | "ubyte", 487 | "byteArray", 488 | ), 489 | 490 | 0x84 => array( 491 | "int", 492 | "short", 493 | "int", 494 | "byte", 495 | "short", 496 | "byteArray", 497 | ), 498 | 499 | 0xc8 => array( 500 | "int", 501 | "byte", 502 | ), 503 | 504 | 0xc9 => array( 505 | "string", 506 | "byte", 507 | "short", 508 | ), 509 | 510 | 0xca => array( 511 | "byte", 512 | "byte", 513 | "byte", 514 | ), 515 | 516 | 0xcb => array( 517 | "string", 518 | ), 519 | 520 | 0xcc => array( 521 | "string", 522 | "byte", 523 | "byte", 524 | "byte", 525 | ), 526 | 527 | 0xcd => array( 528 | "byte", 529 | ), 530 | 531 | 0xfa => array( 532 | "string", 533 | "short", 534 | "byteArray", 535 | ), 536 | 537 | 0xfc => array( 538 | "short", 539 | "byteArray", 540 | "short", 541 | "byteArray", 542 | ), 543 | 544 | 0xfd => array( 545 | "string", 546 | "short", 547 | "byteArray", 548 | "short", 549 | "byteArray", 550 | ), 551 | 552 | 0xfe => array( 553 | ), 554 | 555 | 0xff => array( 556 | "string", 557 | ), 558 | 559 | ); 560 | 561 | 562 | ?> -------------------------------------------------------------------------------- /pstruct/45.php: -------------------------------------------------------------------------------- 1 | array( 40 | "int", 41 | ), 42 | 43 | 0x01 => array( 44 | "int", 45 | "string", 46 | "byte", 47 | "byte", 48 | "byte", 49 | "ubyte", 50 | "ubyte", 51 | ), 52 | 53 | 0x02 => array( 54 | "byte", 55 | "string", 56 | "string", 57 | "int", 58 | ), 59 | 60 | 0x03 => array( 61 | "string", 62 | ), 63 | 64 | 0x04 => array( 65 | "long", 66 | "long", 67 | ), 68 | 69 | 0x05 => array( 70 | "int", 71 | "short", 72 | "slotData", 73 | ), 74 | 75 | 0x06 => array( 76 | "int", 77 | "int", 78 | "int", 79 | ), 80 | 81 | 0x07 => array( 82 | "int", 83 | "int", 84 | "bool", 85 | ), 86 | 87 | 0x08 => array( 88 | "short", 89 | "short", 90 | "float", 91 | ), 92 | 93 | 0x09 => array( 94 | "int", 95 | "byte", 96 | "byte", 97 | "short", 98 | "string", 99 | ), 100 | 101 | 0x0a => array( 102 | "bool", 103 | ), 104 | 105 | 0x0b => array( 106 | "double", 107 | "double", 108 | "double", 109 | "double", 110 | "bool", 111 | ), 112 | 113 | 0x0c => array( 114 | "float", 115 | "float", 116 | "bool", 117 | ), 118 | 119 | 0x0d => array( 120 | "double", 121 | "double", 122 | "double", 123 | "double", 124 | "float", 125 | "float", 126 | "bool", 127 | ), 128 | 129 | 0x0e => array( 130 | "byte", 131 | "int", 132 | "byte", 133 | "int", 134 | "byte", 135 | ), 136 | 137 | 0x0f => array( 138 | "int", 139 | "ubyte", 140 | "int", 141 | "byte", 142 | "slotData", 143 | "byte", 144 | "byte", 145 | "byte", 146 | ), 147 | 148 | 0x10 => array( 149 | "short", 150 | ), 151 | 152 | 0x11 => array( 153 | "int", 154 | "byte", 155 | "int", 156 | "byte", 157 | "int", 158 | ), 159 | 160 | 0x12 => array( 161 | "int", 162 | "byte", 163 | ), 164 | 165 | 0x13 => array( 166 | "int", 167 | "byte", 168 | ), 169 | 170 | 0x14 => array( 171 | "int", 172 | "string", 173 | "int", 174 | "int", 175 | "int", 176 | "byte", 177 | "byte", 178 | "short", 179 | "entityMetadata", 180 | ), 181 | 182 | 0x15 => array( 183 | "int", 184 | "dropArray", 185 | "int", 186 | "int", 187 | "int", 188 | "byte", 189 | "byte", 190 | "byte", 191 | ), 192 | 193 | 0x16 => array( 194 | "int", 195 | "int", 196 | ), 197 | 198 | 0x17 => array( 199 | "int", 200 | "byte", 201 | "int", 202 | "int", 203 | "int", 204 | "int", //if >0, fireball 205 | "short", 206 | "short", 207 | "short", 208 | ), 209 | 210 | 0x18 => array( 211 | "int", 212 | "byte", 213 | "int", 214 | "int", 215 | "int", 216 | "byte", 217 | "byte", 218 | "byte", 219 | "short", 220 | "short", 221 | "short", 222 | "entityMetadata", 223 | ), 224 | 225 | 0x19 => array( 226 | "int", 227 | "string", 228 | "int", 229 | "int", 230 | "int", 231 | "int", 232 | ), 233 | 234 | 0x1a => array( 235 | "int", 236 | "int", 237 | "int", 238 | "int", 239 | "short", 240 | ), 241 | 242 | 0x1c => array( 243 | "int", 244 | "short", 245 | "short", 246 | "short", 247 | ), 248 | 249 | 0x1d => array( 250 | "byte", 251 | "intArray", 252 | ), 253 | 254 | 0x1e => array( 255 | "int", 256 | ), 257 | 258 | 0x1f => array( 259 | "int", 260 | "byte", 261 | "byte", 262 | "byte", 263 | ), 264 | 265 | 0x20 => array( 266 | "int", 267 | "byte", 268 | "byte", 269 | ), 270 | 271 | 0x21 => array( 272 | "int", 273 | "byte", 274 | "byte", 275 | "byte", 276 | "byte", 277 | "byte", 278 | ), 279 | 280 | 0x22 => array( 281 | "int", 282 | "int", 283 | "int", 284 | "int", 285 | "byte", 286 | "byte", 287 | ), 288 | 289 | 0x23 => array( 290 | "int", 291 | "byte", 292 | ), 293 | 294 | 0x26 => array( 295 | "int", 296 | "byte", 297 | ), 298 | 299 | 0x27 => array( 300 | "int", 301 | "int", 302 | ), 303 | 304 | 0x28 => array( 305 | "int", 306 | "entityMetadata", 307 | ), 308 | 309 | 0x29 => array( 310 | "int", 311 | "byte", 312 | "byte", 313 | "short", 314 | ), 315 | 316 | 0x2a => array( 317 | "int", 318 | "byte", 319 | ), 320 | 321 | 0x2b => array( 322 | "float", 323 | "short", 324 | "short", 325 | ), 326 | 327 | 0x33 => array( 328 | "int", 329 | "int", 330 | "bool", 331 | "ushort", 332 | "ushort", 333 | "int", 334 | "byteArray", 335 | ), 336 | 337 | 0x34 => array( 338 | "int", 339 | "int", 340 | "short", 341 | "int", 342 | "newMultiblockArray", 343 | ), 344 | 345 | 0x35 => array( 346 | "int", 347 | "byte", 348 | "int", 349 | "short", 350 | "byte", 351 | ), 352 | 353 | 0x36 => array( 354 | "int", 355 | "short", 356 | "int", 357 | "byte", 358 | "byte", 359 | "short", 360 | ), 361 | 362 | 0x37 => array( 363 | "int", 364 | "int", 365 | "int", 366 | "int", 367 | "byte", 368 | ), 369 | 370 | 0x38 => array( 371 | "short", 372 | "int", 373 | "byteArray", 374 | "chunkInfo", 375 | ), 376 | 377 | 0x3c => array( 378 | "double", 379 | "double", 380 | "double", 381 | "float", 382 | "int", 383 | "explosionRecord", 384 | "float", 385 | "float", 386 | "float", 387 | ), 388 | 389 | 0x3d => array( 390 | "int", 391 | "int", 392 | "byte", 393 | "int", 394 | "int", 395 | ), 396 | 397 | 0x3e => array( 398 | "string", 399 | "int", 400 | "int", 401 | "int", 402 | "float", 403 | "byte", 404 | ), 405 | 406 | 0x46 => array( 407 | "byte", 408 | "byte", 409 | ), 410 | 411 | 0x47 => array( 412 | "int", 413 | "bool", 414 | "int", 415 | "int", 416 | "int", 417 | ), 418 | 419 | 0x64 => array( 420 | "byte", 421 | "byte", 422 | "string", 423 | "byte", 424 | ), 425 | 426 | 0x65 => array( 427 | "byte", 428 | ), 429 | 430 | 0x66 => array( 431 | "byte", 432 | "short", 433 | "byte", 434 | "short", 435 | "byte", 436 | "slotData", 437 | ), 438 | 439 | 0x67 => array( 440 | "byte", 441 | "short", 442 | "slotData", 443 | ), 444 | 445 | 0x68 => array( 446 | "byte", 447 | "short", 448 | "slotArray", 449 | ), 450 | 451 | 0x69 => array( 452 | "byte", 453 | "short", 454 | "short", 455 | ), 456 | 457 | 0x6a => array( 458 | "byte", 459 | "short", 460 | "bool", 461 | ), 462 | 463 | 0x6b => array( 464 | "short", 465 | "slotData", 466 | ), 467 | 468 | 0x6c => array( 469 | "byte", 470 | "byte", 471 | ), 472 | 473 | 0x82 => array( 474 | "int", 475 | "short", 476 | "int", 477 | "string", 478 | "string", 479 | "string", 480 | "string", 481 | ), 482 | 483 | 0x83 => array( 484 | "short", 485 | "short", 486 | "ubyte", 487 | "byteArray", 488 | ), 489 | 490 | 0x84 => array( 491 | "int", 492 | "short", 493 | "int", 494 | "byte", 495 | "short", 496 | "byteArray", 497 | ), 498 | 499 | 0xc8 => array( 500 | "int", 501 | "byte", 502 | ), 503 | 504 | 0xc9 => array( 505 | "string", 506 | "byte", 507 | "short", 508 | ), 509 | 510 | 0xca => array( 511 | "byte", 512 | "byte", 513 | "byte", 514 | ), 515 | 516 | 0xcb => array( 517 | "string", 518 | ), 519 | 520 | 0xcc => array( 521 | "string", 522 | "byte", 523 | "byte", 524 | "byte", 525 | ), 526 | 527 | 0xcd => array( 528 | "byte", 529 | ), 530 | 531 | 0xfa => array( 532 | "string", 533 | "short", 534 | "byteArray", 535 | ), 536 | 537 | 0xfc => array( 538 | "short", 539 | "byteArray", 540 | "short", 541 | "byteArray", 542 | ), 543 | 544 | 0xfd => array( 545 | "string", 546 | "short", 547 | "byteArray", 548 | "short", 549 | "byteArray", 550 | ), 551 | 552 | 0xfe => array( 553 | ), 554 | 555 | 0xff => array( 556 | "string", 557 | ), 558 | 559 | ); 560 | 561 | 562 | ?> -------------------------------------------------------------------------------- /pstruct/46.php: -------------------------------------------------------------------------------- 1 | array( 40 | "int", 41 | ), 42 | 43 | 0x01 => array( 44 | "int", 45 | "string", 46 | "byte", 47 | "byte", 48 | "byte", 49 | "ubyte", 50 | "ubyte", 51 | ), 52 | 53 | 0x02 => array( 54 | "byte", 55 | "string", 56 | "string", 57 | "int", 58 | ), 59 | 60 | 0x03 => array( 61 | "string", 62 | ), 63 | 64 | 0x04 => array( 65 | "long", 66 | "long", 67 | ), 68 | 69 | 0x05 => array( 70 | "int", 71 | "short", 72 | "slotData", 73 | ), 74 | 75 | 0x06 => array( 76 | "int", 77 | "int", 78 | "int", 79 | ), 80 | 81 | 0x07 => array( 82 | "int", 83 | "int", 84 | "bool", 85 | ), 86 | 87 | 0x08 => array( 88 | "short", 89 | "short", 90 | "float", 91 | ), 92 | 93 | 0x09 => array( 94 | "int", 95 | "byte", 96 | "byte", 97 | "short", 98 | "string", 99 | ), 100 | 101 | 0x0a => array( 102 | "bool", 103 | ), 104 | 105 | 0x0b => array( 106 | "double", 107 | "double", 108 | "double", 109 | "double", 110 | "bool", 111 | ), 112 | 113 | 0x0c => array( 114 | "float", 115 | "float", 116 | "bool", 117 | ), 118 | 119 | 0x0d => array( 120 | "double", 121 | "double", 122 | "double", 123 | "double", 124 | "float", 125 | "float", 126 | "bool", 127 | ), 128 | 129 | 0x0e => array( 130 | "byte", 131 | "int", 132 | "byte", 133 | "int", 134 | "byte", 135 | ), 136 | 137 | 0x0f => array( 138 | "int", 139 | "ubyte", 140 | "int", 141 | "byte", 142 | "slotData", 143 | "byte", 144 | "byte", 145 | "byte", 146 | ), 147 | 148 | 0x10 => array( 149 | "short", 150 | ), 151 | 152 | 0x11 => array( 153 | "int", 154 | "byte", 155 | "int", 156 | "byte", 157 | "int", 158 | ), 159 | 160 | 0x12 => array( 161 | "int", 162 | "byte", 163 | ), 164 | 165 | 0x13 => array( 166 | "int", 167 | "byte", 168 | ), 169 | 170 | 0x14 => array( 171 | "int", 172 | "string", 173 | "int", 174 | "int", 175 | "int", 176 | "byte", 177 | "byte", 178 | "short", 179 | "entityMetadata", 180 | ), 181 | 182 | 0x15 => array( 183 | "int", 184 | "dropArray", 185 | "int", 186 | "int", 187 | "int", 188 | "byte", 189 | "byte", 190 | "byte", 191 | ), 192 | 193 | 0x16 => array( 194 | "int", 195 | "int", 196 | ), 197 | 198 | 0x17 => array( 199 | "int", 200 | "byte", 201 | "int", 202 | "int", 203 | "int", 204 | "int", //if >0, fireball 205 | "short", 206 | "short", 207 | "short", 208 | ), 209 | 210 | 0x18 => array( 211 | "int", 212 | "byte", 213 | "int", 214 | "int", 215 | "int", 216 | "byte", 217 | "byte", 218 | "byte", 219 | "short", 220 | "short", 221 | "short", 222 | "entityMetadata", 223 | ), 224 | 225 | 0x19 => array( 226 | "int", 227 | "string", 228 | "int", 229 | "int", 230 | "int", 231 | "int", 232 | ), 233 | 234 | 0x1a => array( 235 | "int", 236 | "int", 237 | "int", 238 | "int", 239 | "short", 240 | ), 241 | 242 | 0x1c => array( 243 | "int", 244 | "short", 245 | "short", 246 | "short", 247 | ), 248 | 249 | 0x1d => array( 250 | "byte", 251 | "intArray", 252 | ), 253 | 254 | 0x1e => array( 255 | "int", 256 | ), 257 | 258 | 0x1f => array( 259 | "int", 260 | "byte", 261 | "byte", 262 | "byte", 263 | ), 264 | 265 | 0x20 => array( 266 | "int", 267 | "byte", 268 | "byte", 269 | ), 270 | 271 | 0x21 => array( 272 | "int", 273 | "byte", 274 | "byte", 275 | "byte", 276 | "byte", 277 | "byte", 278 | ), 279 | 280 | 0x22 => array( 281 | "int", 282 | "int", 283 | "int", 284 | "int", 285 | "byte", 286 | "byte", 287 | ), 288 | 289 | 0x23 => array( 290 | "int", 291 | "byte", 292 | ), 293 | 294 | 0x26 => array( 295 | "int", 296 | "byte", 297 | ), 298 | 299 | 0x27 => array( 300 | "int", 301 | "int", 302 | ), 303 | 304 | 0x28 => array( 305 | "int", 306 | "entityMetadata", 307 | ), 308 | 309 | 0x29 => array( 310 | "int", 311 | "byte", 312 | "byte", 313 | "short", 314 | ), 315 | 316 | 0x2a => array( 317 | "int", 318 | "byte", 319 | ), 320 | 321 | 0x2b => array( 322 | "float", 323 | "short", 324 | "short", 325 | ), 326 | 327 | 0x33 => array( 328 | "int", 329 | "int", 330 | "bool", 331 | "ushort", 332 | "ushort", 333 | "int", 334 | "byteArray", 335 | ), 336 | 337 | 0x34 => array( 338 | "int", 339 | "int", 340 | "short", 341 | "int", 342 | "newMultiblockArray", 343 | ), 344 | 345 | 0x35 => array( 346 | "int", 347 | "byte", 348 | "int", 349 | "short", 350 | "byte", 351 | ), 352 | 353 | 0x36 => array( 354 | "int", 355 | "short", 356 | "int", 357 | "byte", 358 | "byte", 359 | "short", 360 | ), 361 | 362 | 0x37 => array( 363 | "int", 364 | "int", 365 | "int", 366 | "int", 367 | "byte", 368 | ), 369 | 370 | 0x38 => array( 371 | "short", 372 | "int", 373 | "byteArray", 374 | "chunkInfo", 375 | ), 376 | 377 | 0x3c => array( 378 | "double", 379 | "double", 380 | "double", 381 | "float", 382 | "int", 383 | "explosionRecord", 384 | "float", 385 | "float", 386 | "float", 387 | ), 388 | 389 | 0x3d => array( 390 | "int", 391 | "int", 392 | "byte", 393 | "int", 394 | "int", 395 | ), 396 | 397 | 0x3e => array( 398 | "string", 399 | "int", 400 | "int", 401 | "int", 402 | "float", 403 | "byte", 404 | ), 405 | 406 | 0x46 => array( 407 | "byte", 408 | "byte", 409 | ), 410 | 411 | 0x47 => array( 412 | "int", 413 | "bool", 414 | "int", 415 | "int", 416 | "int", 417 | ), 418 | 419 | 0x64 => array( 420 | "byte", 421 | "byte", 422 | "string", 423 | "byte", 424 | ), 425 | 426 | 0x65 => array( 427 | "byte", 428 | ), 429 | 430 | 0x66 => array( 431 | "byte", 432 | "short", 433 | "byte", 434 | "short", 435 | "byte", 436 | "slotData", 437 | ), 438 | 439 | 0x67 => array( 440 | "byte", 441 | "short", 442 | "slotData", 443 | ), 444 | 445 | 0x68 => array( 446 | "byte", 447 | "short", 448 | "slotArray", 449 | ), 450 | 451 | 0x69 => array( 452 | "byte", 453 | "short", 454 | "short", 455 | ), 456 | 457 | 0x6a => array( 458 | "byte", 459 | "short", 460 | "bool", 461 | ), 462 | 463 | 0x6b => array( 464 | "short", 465 | "slotData", 466 | ), 467 | 468 | 0x6c => array( 469 | "byte", 470 | "byte", 471 | ), 472 | 473 | 0x82 => array( 474 | "int", 475 | "short", 476 | "int", 477 | "string", 478 | "string", 479 | "string", 480 | "string", 481 | ), 482 | 483 | 0x83 => array( 484 | "short", 485 | "short", 486 | "ubyte", 487 | "byteArray", 488 | ), 489 | 490 | 0x84 => array( 491 | "int", 492 | "short", 493 | "int", 494 | "byte", 495 | "short", 496 | "byteArray", 497 | ), 498 | 499 | 0xc8 => array( 500 | "int", 501 | "byte", 502 | ), 503 | 504 | 0xc9 => array( 505 | "string", 506 | "byte", 507 | "short", 508 | ), 509 | 510 | 0xca => array( 511 | "byte", 512 | "byte", 513 | "byte", 514 | ), 515 | 516 | 0xcb => array( 517 | "string", 518 | ), 519 | 520 | 0xcc => array( 521 | "string", 522 | "byte", 523 | "byte", 524 | "byte", 525 | "bool", 526 | ), 527 | 528 | 0xcd => array( 529 | "byte", 530 | ), 531 | 532 | 0xfa => array( 533 | "string", 534 | "short", 535 | "byteArray", 536 | ), 537 | 538 | 0xfc => array( 539 | "short", 540 | "byteArray", 541 | "short", 542 | "byteArray", 543 | ), 544 | 545 | 0xfd => array( 546 | "string", 547 | "short", 548 | "byteArray", 549 | "short", 550 | "byteArray", 551 | ), 552 | 553 | 0xfe => array( 554 | ), 555 | 556 | 0xff => array( 557 | "string", 558 | ), 559 | 560 | ); 561 | 562 | 563 | ?> -------------------------------------------------------------------------------- /pstruct/51.php: -------------------------------------------------------------------------------- 1 | array( 40 | "int", 41 | ), 42 | 43 | 0x01 => array( 44 | "int", 45 | "string", 46 | "byte", 47 | "byte", 48 | "byte", 49 | "ubyte", 50 | "ubyte", 51 | ), 52 | 53 | 0x02 => array( 54 | "byte", 55 | "string", 56 | "string", 57 | "int", 58 | ), 59 | 60 | 0x03 => array( 61 | "string", 62 | ), 63 | 64 | 0x04 => array( 65 | "long", 66 | "long", 67 | ), 68 | 69 | 0x05 => array( 70 | "int", 71 | "short", 72 | "slotData", 73 | ), 74 | 75 | 0x06 => array( 76 | "int", 77 | "int", 78 | "int", 79 | ), 80 | 81 | 0x07 => array( 82 | "int", 83 | "int", 84 | "bool", 85 | ), 86 | 87 | 0x08 => array( 88 | "short", 89 | "short", 90 | "float", 91 | ), 92 | 93 | 0x09 => array( 94 | "int", 95 | "byte", 96 | "byte", 97 | "short", 98 | "string", 99 | ), 100 | 101 | 0x0a => array( 102 | "bool", 103 | ), 104 | 105 | 0x0b => array( 106 | "double", 107 | "double", 108 | "double", 109 | "double", 110 | "bool", 111 | ), 112 | 113 | 0x0c => array( 114 | "float", 115 | "float", 116 | "bool", 117 | ), 118 | 119 | 0x0d => array( 120 | "double", 121 | "double", 122 | "double", 123 | "double", 124 | "float", 125 | "float", 126 | "bool", 127 | ), 128 | 129 | 0x0e => array( 130 | "byte", 131 | "int", 132 | "byte", 133 | "int", 134 | "byte", 135 | ), 136 | 137 | 0x0f => array( 138 | "int", 139 | "ubyte", 140 | "int", 141 | "byte", 142 | "slotData", 143 | "byte", 144 | "byte", 145 | "byte", 146 | ), 147 | 148 | 0x10 => array( 149 | "short", 150 | ), 151 | 152 | 0x11 => array( 153 | "int", 154 | "byte", 155 | "int", 156 | "byte", 157 | "int", 158 | ), 159 | 160 | 0x12 => array( 161 | "int", 162 | "byte", 163 | ), 164 | 165 | 0x13 => array( 166 | "int", 167 | "byte", 168 | ), 169 | 170 | 0x14 => array( 171 | "int", 172 | "string", 173 | "int", 174 | "int", 175 | "int", 176 | "byte", 177 | "byte", 178 | "short", 179 | "entityMetadata", 180 | ), 181 | 182 | 0x16 => array( 183 | "int", 184 | "int", 185 | ), 186 | 187 | 0x17 => array( 188 | "int", 189 | "byte", 190 | "int", 191 | "int", 192 | "int", 193 | "byte", 194 | "byte", 195 | "int", //if >0, fireball 196 | "short", 197 | "short", 198 | "short", 199 | ), 200 | 201 | 0x18 => array( 202 | "int", 203 | "byte", 204 | "int", 205 | "int", 206 | "int", 207 | "byte", 208 | "byte", 209 | "byte", 210 | "short", 211 | "short", 212 | "short", 213 | "entityMetadata", 214 | ), 215 | 216 | 0x19 => array( 217 | "int", 218 | "string", 219 | "int", 220 | "int", 221 | "int", 222 | "int", 223 | ), 224 | 225 | 0x1a => array( 226 | "int", 227 | "int", 228 | "int", 229 | "int", 230 | "short", 231 | ), 232 | 233 | 0x1c => array( 234 | "int", 235 | "short", 236 | "short", 237 | "short", 238 | ), 239 | 240 | 0x1d => array( 241 | "byte", 242 | "intArray", 243 | ), 244 | 245 | 0x1e => array( 246 | "int", 247 | ), 248 | 249 | 0x1f => array( 250 | "int", 251 | "byte", 252 | "byte", 253 | "byte", 254 | ), 255 | 256 | 0x20 => array( 257 | "int", 258 | "byte", 259 | "byte", 260 | ), 261 | 262 | 0x21 => array( 263 | "int", 264 | "byte", 265 | "byte", 266 | "byte", 267 | "byte", 268 | "byte", 269 | ), 270 | 271 | 0x22 => array( 272 | "int", 273 | "int", 274 | "int", 275 | "int", 276 | "byte", 277 | "byte", 278 | ), 279 | 280 | 0x23 => array( 281 | "int", 282 | "byte", 283 | ), 284 | 285 | 0x26 => array( 286 | "int", 287 | "byte", 288 | ), 289 | 290 | 0x27 => array( 291 | "int", 292 | "int", 293 | ), 294 | 295 | 0x28 => array( 296 | "int", 297 | "entityMetadata", 298 | ), 299 | 300 | 0x29 => array( 301 | "int", 302 | "byte", 303 | "byte", 304 | "short", 305 | ), 306 | 307 | 0x2a => array( 308 | "int", 309 | "byte", 310 | ), 311 | 312 | 0x2b => array( 313 | "float", 314 | "short", 315 | "short", 316 | ), 317 | 318 | 0x33 => array( 319 | "int", 320 | "int", 321 | "bool", 322 | "ushort", 323 | "ushort", 324 | "int", 325 | "byteArray", 326 | ), 327 | 328 | 0x34 => array( 329 | "int", 330 | "int", 331 | "short", 332 | "int", 333 | "newMultiblockArray", 334 | ), 335 | 336 | 0x35 => array( 337 | "int", 338 | "byte", 339 | "int", 340 | "short", 341 | "byte", 342 | ), 343 | 344 | 0x36 => array( 345 | "int", 346 | "short", 347 | "int", 348 | "byte", 349 | "byte", 350 | "short", 351 | ), 352 | 353 | 0x37 => array( 354 | "int", 355 | "int", 356 | "int", 357 | "int", 358 | "byte", 359 | ), 360 | 361 | 0x38 => array( 362 | "short", 363 | "int", 364 | "bool", 365 | "newNewChunkArray", 366 | "chunkInfo", 367 | ), 368 | 369 | 0x3c => array( 370 | "double", 371 | "double", 372 | "double", 373 | "float", 374 | "int", 375 | "explosionRecord", 376 | "float", 377 | "float", 378 | "float", 379 | ), 380 | 381 | 0x3d => array( 382 | "int", 383 | "int", 384 | "byte", 385 | "int", 386 | "int", 387 | "bool", 388 | ), 389 | 390 | 0x3e => array( 391 | "string", 392 | "int", 393 | "int", 394 | "int", 395 | "float", 396 | "byte", 397 | ), 398 | 399 | 0x46 => array( 400 | "byte", 401 | "byte", 402 | ), 403 | 404 | 0x47 => array( 405 | "int", 406 | "bool", 407 | "int", 408 | "int", 409 | "int", 410 | ), 411 | 412 | 0x64 => array( 413 | "byte", 414 | "byte", 415 | "string", 416 | "byte", 417 | ), 418 | 419 | 0x65 => array( 420 | "byte", 421 | ), 422 | 423 | 0x66 => array( 424 | "byte", 425 | "short", 426 | "byte", 427 | "short", 428 | "byte", 429 | "slotData", 430 | ), 431 | 432 | 0x67 => array( 433 | "byte", 434 | "short", 435 | "slotData", 436 | ), 437 | 438 | 0x68 => array( 439 | "byte", 440 | "short", 441 | "slotArray", 442 | ), 443 | 444 | 0x69 => array( 445 | "byte", 446 | "short", 447 | "short", 448 | ), 449 | 450 | 0x6a => array( 451 | "byte", 452 | "short", 453 | "bool", 454 | ), 455 | 456 | 0x6b => array( 457 | "short", 458 | "slotData", 459 | ), 460 | 461 | 0x6c => array( 462 | "byte", 463 | "byte", 464 | ), 465 | 466 | 0x82 => array( 467 | "int", 468 | "short", 469 | "int", 470 | "string", 471 | "string", 472 | "string", 473 | "string", 474 | ), 475 | 476 | 0x83 => array( 477 | "short", 478 | "short", 479 | "short", 480 | "byteArray", 481 | ), 482 | 483 | 0x84 => array( 484 | "int", 485 | "short", 486 | "int", 487 | "byte", 488 | "short", 489 | "byteArray", 490 | ), 491 | 492 | 0xc8 => array( 493 | "int", 494 | "byte", 495 | ), 496 | 497 | 0xc9 => array( 498 | "string", 499 | "byte", 500 | "short", 501 | ), 502 | 503 | 0xca => array( 504 | "byte", 505 | "byte", 506 | "byte", 507 | ), 508 | 509 | 0xcb => array( 510 | "string", 511 | ), 512 | 513 | 0xcc => array( 514 | "string", 515 | "byte", 516 | "byte", 517 | "byte", 518 | "bool", 519 | ), 520 | 521 | 0xcd => array( 522 | "byte", 523 | ), 524 | 525 | 0xfa => array( 526 | "string", 527 | "short", 528 | "byteArray", 529 | ), 530 | 531 | 0xfc => array( 532 | "short", 533 | "byteArray", 534 | "short", 535 | "byteArray", 536 | ), 537 | 538 | 0xfd => array( 539 | "string", 540 | "short", 541 | "byteArray", 542 | "short", 543 | "byteArray", 544 | ), 545 | 546 | 0xfe => array( 547 | "byte", 548 | ), 549 | 550 | 0xff => array( 551 | "string", 552 | ), 553 | 554 | ); 555 | 556 | 557 | ?> -------------------------------------------------------------------------------- /pstruct/packetName.php: -------------------------------------------------------------------------------- 1 | "Keep Alive", 36 | 0x01 => "Login", 37 | 0x02 => "Handshake", 38 | 0x03 => "Chat Message", 39 | 0x04 => "Time Update", 40 | 0x05 => "Entity Equipment", 41 | 0x06 => "Spawn Position", 42 | 0x07 => "Use Entity", 43 | 0x08 => "Update Health", 44 | 0x09 => "Respawn", 45 | 0x0a => "Player", 46 | 0x0b => "Player Position", 47 | 0x0c => "Player Look", 48 | 0x0d => "Player Position & Look", 49 | 0x0e => "Player Digging", 50 | 0x0f => "Player Block Placement", 51 | 0x10 => "Slot Change", 52 | 0x11 => "Use Bed", 53 | 0x12 => "Animation", 54 | 0x13 => "Entity Action", 55 | 0x14 => "Spawn Named Entity", 56 | 0x15 => "Spawn Dropped Item", 57 | 0x16 => "Collect Item", 58 | 0x17 => "Spawn Object/Vehicle", 59 | 0x18 => "Spawn Mob", 60 | 0x19 => "Spawn Painting", 61 | 0x1a => "Spawn Experience Orb", 62 | 0x1c => "Entity Velocity", 63 | 0x1d => "Destroy Entity", 64 | 0x1e => "Entity", 65 | 0x1f => "Entity Relative Move", 66 | 0x20 => "Entity Look", 67 | 0x21 => "Entity Look & Relative Move", 68 | 0x22 => "Entity Teleport", 69 | 0x23 => "Entity Head Look", 70 | 71 | 0x26 => "Entity Status", 72 | 0x27 => "Attach Entity", 73 | 0x28 => "Entity Metadata", 74 | 0x29 => "Entity Effect", 75 | 0x2a => "Remove Entity Effect", 76 | 0x2b => "Set Experience", 77 | 78 | 0x32 => "Chunk Allocation", 79 | 0x33 => "Chunk Data", 80 | 0x34 => "Multi Block Change", 81 | 0x35 => "Block Change", 82 | 0x36 => "Block Action", 83 | 0x37 => "Block Break Animation", 84 | 0x38 => "Map Chunk Bulk", 85 | 86 | 0x3c => "Explosion", 87 | 0x3d => "Sound/Particle Effect", 88 | 0x3e => "Named Sound Effect", 89 | 90 | 0x46 => "Change Game State", 91 | 0x47 => "Global Entity", 92 | 93 | 0x64 => "Open Window", 94 | 0x65 => "Close Window", 95 | 0x66 => "Click Window", 96 | 0x67 => "Set Slot", 97 | 0x68 => "Set Window Items", 98 | 0x69 => "Update Window Property", 99 | 0x6a => "Confirm Transaction", 100 | 0x6b => "Creative Inventory Action", 101 | 0x6c => "Enchant Item", 102 | 103 | 0x82 => "Update Sign", 104 | 0x83 => "Item Data", 105 | 0x84 => "Update Tile Entity", 106 | 107 | 0xc8 => "Increment Statistic", 108 | 0xc9 => "Player List Item", 109 | 0xca => "Player Abilities", 110 | 0xcb => "Tab-complete", 111 | 0xcc => "Locale and View Distance", 112 | 0xcd => "Client Statuses", 113 | 114 | 0xfa => "Plugin Message", 115 | 116 | 0xfc => "Encryption Key Response", 117 | 0xfd => "Encryption Key Request", 118 | 0xfe => "Server List Ping", 119 | 0xff => "Kick", 120 | 121 | ); -------------------------------------------------------------------------------- /pstruct/spout.php: -------------------------------------------------------------------------------- 1 | array( 38 | "string", 39 | ), 40 | 44 => array( 41 | 42 | ), 43 | 44 | ); --------------------------------------------------------------------------------