mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-13 15:05:33 +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->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() != ""){
|
if($ev->getQuitMessage() != ""){
|
||||||
$this->server->broadcastMessage($ev->getQuitMessage());
|
$this->server->broadcastMessage($ev->getQuitMessage());
|
||||||
}
|
}
|
||||||
|
@ -48,6 +48,10 @@ class Ice extends Transparent{
|
|||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getFrictionFactor() : float{
|
||||||
|
return 0.98;
|
||||||
|
}
|
||||||
|
|
||||||
public function getToolType() : int{
|
public function getToolType() : int{
|
||||||
return Tool::TYPE_PICKAXE;
|
return Tool::TYPE_PICKAXE;
|
||||||
}
|
}
|
||||||
|
@ -41,6 +41,10 @@ class PackedIce extends Solid{
|
|||||||
return 0.5;
|
return 0.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getFrictionFactor() : float{
|
||||||
|
return 0.98;
|
||||||
|
}
|
||||||
|
|
||||||
public function getToolType() : int{
|
public function getToolType() : int{
|
||||||
return Tool::TYPE_PICKAXE;
|
return Tool::TYPE_PICKAXE;
|
||||||
}
|
}
|
||||||
|
@ -34,14 +34,18 @@ class PlayerQuitEvent extends PlayerEvent{
|
|||||||
|
|
||||||
/** @var TranslationContainer|string */
|
/** @var TranslationContainer|string */
|
||||||
protected $quitMessage;
|
protected $quitMessage;
|
||||||
|
/** @var string */
|
||||||
|
protected $quitReason;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Player $player
|
* @param Player $player
|
||||||
* @param TranslationContainer|string $quitMessage
|
* @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->player = $player;
|
||||||
$this->quitMessage = $quitMessage;
|
$this->quitMessage = $quitMessage;
|
||||||
|
$this->quitReason = $quitReason;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -57,4 +61,11 @@ class PlayerQuitEvent extends PlayerEvent{
|
|||||||
public function getQuitMessage(){
|
public function getQuitMessage(){
|
||||||
return $this->quitMessage;
|
return $this->quitMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getQuitReason() : string{
|
||||||
|
return $this->quitReason;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -48,13 +48,16 @@ class CraftingDataPacket extends DataPacket{
|
|||||||
/** @var bool */
|
/** @var bool */
|
||||||
public $cleanRecipes = false;
|
public $cleanRecipes = false;
|
||||||
|
|
||||||
|
public $decodedEntries = [];
|
||||||
|
|
||||||
public function clean(){
|
public function clean(){
|
||||||
$this->entries = [];
|
$this->entries = [];
|
||||||
|
$this->decodedEntries = [];
|
||||||
return parent::clean();
|
return parent::clean();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function decodePayload(){
|
protected function decodePayload(){
|
||||||
$entries = [];
|
$this->decodedEntries = [];
|
||||||
$recipeCount = $this->getUnsignedVarInt();
|
$recipeCount = $this->getUnsignedVarInt();
|
||||||
for($i = 0; $i < $recipeCount; ++$i){
|
for($i = 0; $i < $recipeCount; ++$i){
|
||||||
$entry = [];
|
$entry = [];
|
||||||
@ -106,7 +109,7 @@ class CraftingDataPacket extends DataPacket{
|
|||||||
default:
|
default:
|
||||||
throw new \UnexpectedValueException("Unhandled recipe type $recipeType!"); //do not continue attempting to decode
|
throw new \UnexpectedValueException("Unhandled recipe type $recipeType!"); //do not continue attempting to decode
|
||||||
}
|
}
|
||||||
$entries[] = $entry;
|
$this->decodedEntries[] = $entry;
|
||||||
}
|
}
|
||||||
$this->getBool(); //cleanRecipes
|
$this->getBool(); //cleanRecipes
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user