mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 19:49:44 +00:00
Send Inventory Support
This commit is contained in:
parent
506b9f4a4f
commit
967a929723
3 changed files with 45 additions and 1 deletions
|
|
@ -148,6 +148,18 @@ class Utils extends Thread{
|
|||
$m .= "\x7f";
|
||||
return $m;
|
||||
}
|
||||
|
||||
public static function writeSlot(Item $item){
|
||||
return Utils::writeShort($item->getID()).chr($item->count).Utils::writeShort($item->getMetadata());
|
||||
}
|
||||
|
||||
public static function readSlot($str){
|
||||
return BlockAPI::getItem(
|
||||
Utils::readShort(substr($str, 0, 2), false),
|
||||
Utils::readShort(substr($str, 3, 2), false),
|
||||
ord($str{2})
|
||||
);
|
||||
}
|
||||
|
||||
public static function readMetadata($value, $types = false){
|
||||
$offset = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue