Add a "should burn in sunlight" API for Phantoms and Skeletons

This commit is contained in:
MeFisto94 2021-05-11 00:48:51 +02:00
parent 07e76ccd5b
commit 613ffeaeed
2 changed files with 34 additions and 0 deletions

View file

@ -32,4 +32,24 @@ public interface AbstractSkeleton extends Monster, com.destroystokyo.paper.entit
@Deprecated(since = "1.17")
@Contract("_ -> fail")
public void setSkeletonType(Skeleton.SkeletonType type);
// Paper start
/**
* Check if this skeleton will burn in the sunlight. This
* does not take into account an entity's natural fire
* immunity.
*
* @return True if skeleton will burn in sunlight
*/
boolean shouldBurnInDay();
/**
* Set if this skeleton should burn in the sunlight. This
* will not override an entity's natural fire
* immunity.
*
* @param shouldBurnInDay True to burn in sunlight
*/
void setShouldBurnInDay(boolean shouldBurnInDay);
// Paper end
}

View file

@ -26,5 +26,19 @@ public interface Phantom extends Flying, Enemy {
*/
@Nullable
public java.util.UUID getSpawningEntity();
/**
* Check if this phantom will burn in the sunlight
*
* @return True if phantom will burn in sunlight
*/
public boolean shouldBurnInDay();
/**
* Set if this phantom should burn in the sunlight
*
* @param shouldBurnInDay True to burn in sunlight
*/
public void setShouldBurnInDay(boolean shouldBurnInDay);
// Paper end
}