Merge branch 'master' into master

This commit is contained in:
yefengeeeeeeeeeee 2025-04-12 13:05:30 +08:00 • committed by GitHub
commit fee80da366
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 78 additions and 9 deletions

View file

@ -1523,6 +1523,7 @@ class Player{
}
}
public function sendPing() {
$pk = new PingPacket;
$pk->time = intdiv(hrtime(true), 1_000_000);
@ -3236,6 +3237,7 @@ class Player{
}
if ($this->blocked === true or ($this->entity->position instanceof Vector3 and $blockVector->distance($this->entity->position) > 10)) {
} elseif ($this->getSlot($this->slot)->getID() !== $packet->item or ($this->getSlot($this->slot)->isTool() === false and $this->getSlot($this->slot)->getMetadata() !== $packet->meta)) {
@ -6089,7 +6091,7 @@ class Player{
$s = $this->getSlot($slot);
if($s->count <= 0 or $s->getID() === AIR){
$this->setSlot($slot, BlockAPI::getItem($item->getID(), $item->getMetadata(), $item->count), false);
}else if($s->getID() == $item->getID() && $s->getMetadata() == $item->getMetadata() && ($s->count + $item->count) <= $s->maxStackSize){
}else if($s->getID() == $item->getID() && $s->getMetadata() == $item->getMetadata() && ($s->count + $item->count) <= $s->getMaxStackSize()){
$this->setSlot($slot, BlockAPI::getItem($item->getID(), $item->getMetadata(), $s->count + $item->count), false);
}else{
$f1 = 0.3;