Fixed "player.interact" event only being fired with weird conditions

This commit is contained in:
Shoghi Cervantes Pueyo 2013-04-22 18:46:35 +02:00
parent d552042094
commit 34ca8baa29
3 changed files with 15 additions and 13 deletions

View file

@ -155,11 +155,13 @@ class Utils{
return Utils::writeShort($item->getID()).chr($item->count).Utils::writeShort($item->getMetadata());
}
public static function readSlot($str){
public static function readSlot($ob){
$id = Utils::readShort($ob->get(2));
$cnt = ord($ob->get(1));
return BlockAPI::getItem(
Utils::readShort(substr($str, 0, 2), false),
Utils::readShort(substr($str, 3, 2), false),
ord($str{2})
$id,
Utils::readShort($ob->get(2)),
$cnt
);
}