mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-04 00:55:14 +00:00
Fixed really dumb copy bug breaking crafting
This commit is contained in:
@ -2924,7 +2924,7 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
|
|||||||
if(!$canCraft or !$recipe->getResult()->equals($result)){
|
if(!$canCraft or !$recipe->getResult()->equals($result)){
|
||||||
$this->server->getLogger()->debug("Unmatched recipe " . $recipe->getId() . " from player " . $this->getName() . ": expected " . $recipe->getResult() . ", got " . $result . ", using: " . implode(", ", $ingredients));
|
$this->server->getLogger()->debug("Unmatched recipe " . $recipe->getId() . " from player " . $this->getName() . ": expected " . $recipe->getResult() . ", got " . $result . ", using: " . implode(", ", $ingredients));
|
||||||
$this->inventory->sendContents($this);
|
$this->inventory->sendContents($this);
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$used = array_fill(0, $this->inventory->getSize(), 0);
|
$used = array_fill(0, $this->inventory->getSize(), 0);
|
||||||
@ -2948,7 +2948,7 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
|
|||||||
if(!$canCraft){
|
if(!$canCraft){
|
||||||
$this->server->getLogger()->debug("Unmatched recipe " . $recipe->getId() . " from player " . $this->getName() . ": client does not have enough items, using: " . implode(", ", $ingredients));
|
$this->server->getLogger()->debug("Unmatched recipe " . $recipe->getId() . " from player " . $this->getName() . ": client does not have enough items, using: " . implode(", ", $ingredients));
|
||||||
$this->inventory->sendContents($this);
|
$this->inventory->sendContents($this);
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->server->getPluginManager()->callEvent($ev = new CraftItemEvent($this, $ingredients, $recipe));
|
$this->server->getPluginManager()->callEvent($ev = new CraftItemEvent($this, $ingredients, $recipe));
|
||||||
|
@ -140,7 +140,7 @@ class PacketPool{
|
|||||||
* @return DataPacket
|
* @return DataPacket
|
||||||
*/
|
*/
|
||||||
public static function getPacketById(int $pid) : DataPacket{
|
public static function getPacketById(int $pid) : DataPacket{
|
||||||
return static::$pool[$pid] ?? new UnknownPacket();
|
return isset(static::$pool[$pid]) ? clone static::$pool[$pid] : new UnknownPacket();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user