mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-12 14:35:35 +00:00
Merge branch 'master' into mcpe-1.2
This commit is contained in:
commit
2443a57234
@ -3471,7 +3471,7 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
|
||||
$this->server->getLogger()->logException($e);
|
||||
}
|
||||
|
||||
$this->server->getPluginManager()->callEvent($ev = new PlayerQuitEvent($this, $message));
|
||||
$this->server->getPluginManager()->callEvent($ev = new PlayerQuitEvent($this, $message, $reason));
|
||||
if($ev->getQuitMessage() != ""){
|
||||
$this->server->broadcastMessage($ev->getQuitMessage());
|
||||
}
|
||||
|
@ -48,6 +48,10 @@ class Ice extends Transparent{
|
||||
return 2;
|
||||
}
|
||||
|
||||
public function getFrictionFactor() : float{
|
||||
return 0.98;
|
||||
}
|
||||
|
||||
public function getToolType() : int{
|
||||
return Tool::TYPE_PICKAXE;
|
||||
}
|
||||
|
@ -41,6 +41,10 @@ class PackedIce extends Solid{
|
||||
return 0.5;
|
||||
}
|
||||
|
||||
public function getFrictionFactor() : float{
|
||||
return 0.98;
|
||||
}
|
||||
|
||||
public function getToolType() : int{
|
||||
return Tool::TYPE_PICKAXE;
|
||||
}
|
||||
|
@ -34,14 +34,18 @@ class PlayerQuitEvent extends PlayerEvent{
|
||||
|
||||
/** @var TranslationContainer|string */
|
||||
protected $quitMessage;
|
||||
/** @var string */
|
||||
protected $quitReason;
|
||||
|
||||
/**
|
||||
* @param Player $player
|
||||
* @param TranslationContainer|string $quitMessage
|
||||
* @param string $quitReason
|
||||
*/
|
||||
public function __construct(Player $player, $quitMessage){
|
||||
public function __construct(Player $player, $quitMessage, string $quitReason){
|
||||
$this->player = $player;
|
||||
$this->quitMessage = $quitMessage;
|
||||
$this->quitReason = $quitReason;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -57,4 +61,11 @@ class PlayerQuitEvent extends PlayerEvent{
|
||||
public function getQuitMessage(){
|
||||
return $this->quitMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getQuitReason() : string{
|
||||
return $this->quitReason;
|
||||
}
|
||||
}
|
||||
|
@ -48,13 +48,16 @@ class CraftingDataPacket extends DataPacket{
|
||||
/** @var bool */
|
||||
public $cleanRecipes = false;
|
||||
|
||||
public $decodedEntries = [];
|
||||
|
||||
public function clean(){
|
||||
$this->entries = [];
|
||||
$this->decodedEntries = [];
|
||||
return parent::clean();
|
||||
}
|
||||
|
||||
protected function decodePayload(){
|
||||
$entries = [];
|
||||
$this->decodedEntries = [];
|
||||
$recipeCount = $this->getUnsignedVarInt();
|
||||
for($i = 0; $i < $recipeCount; ++$i){
|
||||
$entry = [];
|
||||
@ -106,7 +109,7 @@ class CraftingDataPacket extends DataPacket{
|
||||
default:
|
||||
throw new \UnexpectedValueException("Unhandled recipe type $recipeType!"); //do not continue attempting to decode
|
||||
}
|
||||
$entries[] = $entry;
|
||||
$this->decodedEntries[] = $entry;
|
||||
}
|
||||
$this->getBool(); //cleanRecipes
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user