mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-01 07:39:57 +00:00
Fix player burn time in creative
This commit is contained in:
parent
aaf549a469
commit
86dc8c48b9
@ -1235,6 +1235,10 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
return $this->gamemode === Player::SPECTATOR;
|
return $this->gamemode === Player::SPECTATOR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function isFireProof() : bool{
|
||||||
|
return $this->isCreative();
|
||||||
|
}
|
||||||
|
|
||||||
public function getDrops(){
|
public function getDrops(){
|
||||||
if(!$this->isCreative()){
|
if(!$this->isCreative()){
|
||||||
return parent::getDrops();
|
return parent::getDrops();
|
||||||
|
@ -251,7 +251,6 @@ abstract class Entity extends Location implements Metadatable{
|
|||||||
|
|
||||||
public $noDamageTicks;
|
public $noDamageTicks;
|
||||||
protected $justCreated;
|
protected $justCreated;
|
||||||
protected $fireProof;
|
|
||||||
private $invulnerable;
|
private $invulnerable;
|
||||||
|
|
||||||
/** @var AttributeMap */
|
/** @var AttributeMap */
|
||||||
@ -937,10 +936,11 @@ abstract class Entity extends Location implements Metadatable{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if($this->fireTicks > 0){
|
if($this->fireTicks > 0){
|
||||||
if($this->fireProof){
|
if($this->isFireProof()){
|
||||||
$this->fireTicks -= 4 * $tickDiff;
|
if($this->fireTicks > 1){
|
||||||
if($this->fireTicks < 0){
|
$this->fireTicks = 1;
|
||||||
$this->fireTicks = 0;
|
}else{
|
||||||
|
$this->fireTicks -= 1;
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
if(!$this->hasEffect(Effect::FIRE_RESISTANCE) and (($this->fireTicks % 20) === 0 or $tickDiff > 20)){
|
if(!$this->hasEffect(Effect::FIRE_RESISTANCE) and (($this->fireTicks % 20) === 0 or $tickDiff > 20)){
|
||||||
@ -1066,6 +1066,10 @@ abstract class Entity extends Location implements Metadatable{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function isFireProof() : bool{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public function getDirection(){
|
public function getDirection(){
|
||||||
$rotation = ($this->yaw - 90) % 360;
|
$rotation = ($this->yaw - 90) % 360;
|
||||||
if($rotation < 0){
|
if($rotation < 0){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user