Fixed ContainerSetContentPacket being spammed before join

This commit is contained in:
Shoghi Cervantes 2014-05-30 01:26:57 +02:00
parent 0925898d8d
commit 5117bbf7f4
3 changed files with 4 additions and 4 deletions

View File

@ -446,7 +446,7 @@ abstract class Entity extends Position implements Metadatable{
$this->server->broadcastPacket($this->hasSpawned, $pk);
}
if(!($this instanceof Player) and ($this->lastMotionX != $this->motionX or $this->lastMotionY != $this->motionY or $this->lastMotionZ != $this->motionZ) and ($this->ticksLived % 20) === 0){
if(!($this instanceof Player) and ($this->lastMotionX != $this->motionX or $this->lastMotionY != $this->motionY or $this->lastMotionZ != $this->motionZ)){
$this->lastMotionX = $this->motionX;
$this->lastMotionY = $this->motionY;
$this->lastMotionZ = $this->motionZ;

View File

@ -65,9 +65,9 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{
if($item["Slot"] >= 0 and $item["Slot"] < 9){ //Hotbar
$this->inventory->setHotbarSlotIndex($item["Slot"], isset($item["TrueSlot"]) ? $item["TrueSlot"] : -1);
}elseif($item["Slot"] >= 100 and $item["Slot"] < 104){ //Armor
$this->inventory->setItem($this->inventory->getSize() + $item["Slot"] - 100, Item::get($item["id"], $item["Damage"], $item["Count"]));
$this->inventory->setItem($this->inventory->getSize() + $item["Slot"] - 100, Item::get($item["id"], $item["Damage"], $item["Count"]), $this);
}else{
$this->inventory->setItem($item["Slot"] - 9, Item::get($item["id"], $item["Damage"], $item["Count"]));
$this->inventory->setItem($item["Slot"] - 9, Item::get($item["id"], $item["Damage"], $item["Count"]), $this);
}
}

View File

@ -145,7 +145,7 @@ class PlayerInventory extends BaseInventory{
}
public function onSlotChange($index, $before, $source = null){
parent::onSlotChange($index, $before);
parent::onSlotChange($index, $before, $source);
if($index >= $this->getSize()){
$this->sendArmorContents($this->getHolder()->getViewers());