Merge branch 'release/3.3'

This commit is contained in:
Dylan K. Taylor
2018-10-05 18:11:33 +01:00
28 changed files with 182 additions and 139 deletions

View File

@ -269,7 +269,8 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{
* @return float the amount of exhaustion level increased
*/
public function exhaust(float $amount, int $cause = PlayerExhaustEvent::CAUSE_CUSTOM) : float{
$this->server->getPluginManager()->callEvent($ev = new PlayerExhaustEvent($this, $amount, $cause));
$ev = new PlayerExhaustEvent($this, $amount, $cause);
$ev->call();
if($ev->isCancelled()){
return 0.0;
}
@ -466,7 +467,7 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{
protected function setXpAndProgress(?int $level, ?float $progress) : bool{
if(!$this->justCreated){
$ev = new PlayerExperienceChangeEvent($this, $this->getXpLevel(), $this->getXpProgress(), $level, $progress);
$this->server->getPluginManager()->callEvent($ev);
$ev->call();
if($ev->isCancelled()){
return false;