small tweaks

This commit is contained in:
GameHerobrine 2023-01-28 13:32:28 +03:00
parent a7ebdb35bd
commit c3750014a9
4 changed files with 5 additions and 6 deletions

View file

@ -511,7 +511,7 @@ class BlockAPI{
if(($player->gamemode & 0x01) === 0x00){
--$item->count;
if($item->count <= 0){
$player->setSlot($player->slot, BlockAPI::getItem(AIR, 0, 0), true);
$player->setSlot($player->slot, BlockAPI::getItem(AIR, 0, 0), false);
}
}

View file

@ -1747,7 +1747,7 @@ class Player{
}elseif($s->getID() !== AIR and $slot->getID() !== AIR and ($slot->getID() !== $s->getID() or $slot->getMetadata() !== $s->getMetadata()) and ($sl = $this->hasItem($s->getID())) !== false){
$item = $this->armor[$i];
$this->armor[$i] = $this->getSlot($sl);
$this->setSlot($sl, $item, true);
$this->setSlot($sl, $item, false);
}else{
$packet->slots[$i] = 255;
}

View file

@ -350,7 +350,7 @@ class PocketMinecraftServer{
$hnid = $this->handCnt++;
$this->handlers[$hnid] = $callable;
$this->query("INSERT INTO handlers (ID, name, priority) VALUES (" . $hnid . ", '" . str_replace("'", "\\'", $event) . "', " . $priority . ");");
console("[INTERNAL] New handler " . (is_array($callable) ? get_class($callable[0]) . "::" . $callable[1] : $callable) . " to special event " . $event . " (ID " . $hnid . ")", true, true, 3);
//console("[INTERNAL] New handler " . (is_array($callable) ? get_class($callable[0]) . "::" . $callable[1] : $callable) . " to special event " . $event . " (ID " . $hnid . ")", true, true, 3);
return $hnid;
}
@ -596,7 +596,7 @@ class PocketMinecraftServer{
$this->preparedSQL->updateAction->bindValue(":time", $time, SQLITE3_FLOAT);
$this->preparedSQL->updateAction->bindValue(":id", $cid, SQLITE3_INTEGER);
$this->preparedSQL->updateAction->execute();
if(!@is_callable($this->schedule[$cid][0])){
if(!isset($this->schedule[$cid]) || !isset($this->schedule[$cid][0]) || !@is_callable($this->schedule[$cid][0])){
$return = false;
}else{
++$actionCount;

View file

@ -13,5 +13,4 @@ if exist bin\php\php.exe (
) else (
php -d enable_dl=On PocketMine-MP.php %*
)
)
)