mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-17 03:08:58 +00:00
Fixed derp x3
This commit is contained in:
parent
c6c0b75eae
commit
5241d8ff13
@ -467,7 +467,7 @@ class Player extends PlayerEntity{
|
|||||||
//Normal inventory
|
//Normal inventory
|
||||||
$slotCount = (($this->gamemode & 0x01) === 0 ? PLAYER_SURVIVAL_SLOTS:PLAYER_CREATIVE_SLOTS) + 9;
|
$slotCount = (($this->gamemode & 0x01) === 0 ? PLAYER_SURVIVAL_SLOTS:PLAYER_CREATIVE_SLOTS) + 9;
|
||||||
for($slot = 9; $slot < $slotCount; ++$slot){
|
for($slot = 9; $slot < $slotCount; ++$slot){
|
||||||
$item = $this->getSlot($count);
|
$item = $this->getSlot($slot);
|
||||||
$this->namedtag->Inventory[$slot] = new NBTTag_Compound(false, array(
|
$this->namedtag->Inventory[$slot] = new NBTTag_Compound(false, array(
|
||||||
"Count" => new NBTTag_Byte("Count", $item->getCount()),
|
"Count" => new NBTTag_Byte("Count", $item->getCount()),
|
||||||
"Damage" => new NBTTag_Short("Damage", $item->getMetadata()),
|
"Damage" => new NBTTag_Short("Damage", $item->getMetadata()),
|
||||||
|
@ -215,7 +215,11 @@ class HumanEntity extends CreatureEntity implements ProjectileSourceEntity, Inve
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function getSlot($slot){
|
public function getSlot($slot){
|
||||||
$this->inventory[(int) $slot] = $item;
|
$slot = (int) $slot;
|
||||||
|
if(!($this->inventory[$slot] instanceof Item)){
|
||||||
|
$this->inventory[$slot] = BlockAPI::getItem(AIR, 0, 0);
|
||||||
|
}
|
||||||
|
return $this->inventory[$slot];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAllSlots(){
|
public function getAllSlots(){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user