mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-22 04:29:43 +00:00
Added chest pairing
This commit is contained in:
parent
e8c273fc10
commit
176c371330
5 changed files with 252 additions and 131 deletions
|
|
@ -65,32 +65,11 @@ class BurningFurnaceBlock extends SolidBlock{
|
|||
));
|
||||
}
|
||||
|
||||
if($furnace->class !== TILE_FURNACE or ($player->gamemode & 0x01) === 0x01){
|
||||
if(($player->gamemode & 0x01) === 0x01){
|
||||
return true;
|
||||
}
|
||||
$player->windowCnt++;
|
||||
$player->windowCnt = $id = max(2, $player->windowCnt % 99);
|
||||
$player->windows[$id] = $furnace;
|
||||
$player->dataPacket(MC_CONTAINER_OPEN, array(
|
||||
"windowid" => $id,
|
||||
"type" => WINDOW_FURNACE,
|
||||
"slots" => FURNACE_SLOTS,
|
||||
"title" => "Furnace",
|
||||
));
|
||||
$slots = array();
|
||||
for($s = 0; $s < FURNACE_SLOTS; ++$s){
|
||||
$slot = $furnace->getSlot($s);
|
||||
if($slot->getID() > 0 and $slot->count > 0){
|
||||
$slots[] = $slot;
|
||||
}else{
|
||||
$slots[] = BlockAPI::getItem(AIR, 0, 0);
|
||||
}
|
||||
}
|
||||
$player->dataPacket(MC_CONTAINER_SET_CONTENT, array(
|
||||
"windowid" => $id,
|
||||
"count" => count($slots),
|
||||
"slots" => $slots
|
||||
));
|
||||
|
||||
$furnace->openInventory($player);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue