mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 12:09:43 +00:00
Some changes.
This commit is contained in:
parent
20c16068ec
commit
d6cc8415dc
30 changed files with 359 additions and 106 deletions
|
|
@ -800,12 +800,29 @@ class CustomPacketHandler{
|
|||
for($s = 0; $s < $this->data["count"] and !$this->feof(); ++$s){
|
||||
$this->data["slots"][$s] = Utils::readSlot($this);
|
||||
}
|
||||
if($this->data["windowid"] == 0){
|
||||
$slots = min(9, Utils::readShort($this->get(2), false));
|
||||
$this->data["hotbar"] = array();
|
||||
if($slots > 0){
|
||||
for($s = 0; $s < $slots; ++$s){
|
||||
$this->data["hotbar"][$s] = Utils::readInt($this->get(4));
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
$this->raw .= chr($this->data["windowid"]);
|
||||
$this->raw .= Utils::writeShort(count($this->data["slots"]));
|
||||
foreach($this->data["slots"] as $slot){
|
||||
$this->raw .= Utils::writeSlot($slot);
|
||||
}
|
||||
if($this->data["windowid"] == 0 and isset($this->data["hotbar"])){
|
||||
if(count($this->data["hotbar"]) > 0){
|
||||
$this->raw .= Utils::writeShort(count($this->data["hotbar"]));
|
||||
foreach($this->data["hotbar"] as $slot){
|
||||
$this->raw .= Utils::writeInt($slot);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case MC_CONTAINER_SET_DATA:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue