mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 04:17:07 +00:00
Fixed ContainerSetContentPacket being spammed before join
This commit is contained in:
parent
0925898d8d
commit
5117bbf7f4
@ -446,7 +446,7 @@ abstract class Entity extends Position implements Metadatable{
|
|||||||
$this->server->broadcastPacket($this->hasSpawned, $pk);
|
$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->lastMotionX = $this->motionX;
|
||||||
$this->lastMotionY = $this->motionY;
|
$this->lastMotionY = $this->motionY;
|
||||||
$this->lastMotionZ = $this->motionZ;
|
$this->lastMotionZ = $this->motionZ;
|
||||||
|
@ -65,9 +65,9 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{
|
|||||||
if($item["Slot"] >= 0 and $item["Slot"] < 9){ //Hotbar
|
if($item["Slot"] >= 0 and $item["Slot"] < 9){ //Hotbar
|
||||||
$this->inventory->setHotbarSlotIndex($item["Slot"], isset($item["TrueSlot"]) ? $item["TrueSlot"] : -1);
|
$this->inventory->setHotbarSlotIndex($item["Slot"], isset($item["TrueSlot"]) ? $item["TrueSlot"] : -1);
|
||||||
}elseif($item["Slot"] >= 100 and $item["Slot"] < 104){ //Armor
|
}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{
|
}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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -145,7 +145,7 @@ class PlayerInventory extends BaseInventory{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function onSlotChange($index, $before, $source = null){
|
public function onSlotChange($index, $before, $source = null){
|
||||||
parent::onSlotChange($index, $before);
|
parent::onSlotChange($index, $before, $source);
|
||||||
|
|
||||||
if($index >= $this->getSize()){
|
if($index >= $this->getSize()){
|
||||||
$this->sendArmorContents($this->getHolder()->getViewers());
|
$this->sendArmorContents($this->getHolder()->getViewers());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user