mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-08-31 23:33:06 +00:00
Fixed really dumb copy bug breaking crafting
This commit is contained in:
parent
6cacb368ce
commit
f32e880542
@ -2924,7 +2924,7 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
|
||||
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->inventory->sendContents($this);
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
$used = array_fill(0, $this->inventory->getSize(), 0);
|
||||
@ -2948,7 +2948,7 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
|
||||
if(!$canCraft){
|
||||
$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);
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->server->getPluginManager()->callEvent($ev = new CraftItemEvent($this, $ingredients, $recipe));
|
||||
|
@ -140,7 +140,7 @@ class PacketPool{
|
||||
* @return 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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user