Fixed SoulFire damage (#5138)

This commit is contained in:
ipad54 2022-07-06 16:57:07 +03:00 committed by GitHub
parent a8728a02f6
commit a377795db9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 1 deletions

View File

@ -41,7 +41,7 @@ abstract class BaseFire extends Flowable{
}
public function onEntityInside(Entity $entity) : bool{
$ev = new EntityDamageByBlockEvent($this, $entity, EntityDamageEvent::CAUSE_FIRE, 1);
$ev = new EntityDamageByBlockEvent($this, $entity, EntityDamageEvent::CAUSE_FIRE, $this->getFireDamage());
$entity->attack($ev);
$ev = new EntityCombustByBlockEvent($this, $entity, 8);
@ -55,6 +55,8 @@ abstract class BaseFire extends Flowable{
return true;
}
abstract protected function getFireDamage() : int;
public function getDropsForCompatibleTool(Item $item) : array{
return [];
}

View File

@ -61,6 +61,10 @@ class Fire extends BaseFire{
return $this;
}
protected function getFireDamage() : int{
return 1;
}
public function onNearbyBlockChange() : void{
$down = $this->getSide(Facing::DOWN);
if(SoulFire::canBeSupportedBy($down)){

View File

@ -31,6 +31,10 @@ final class SoulFire extends BaseFire{
return 10;
}
protected function getFireDamage() : int{
return 2;
}
public static function canBeSupportedBy(Block $block) : bool{
//TODO: this really ought to use some kind of tag system
$id = $block->getTypeId();