SPIGOT-4526: Add conversion time API for Zombie & subclasses

By: md_5 <git@md-5.net>
This commit is contained in:
Bukkit/Spigot
2018-12-13 14:10:26 +11:00
parent 3f4b83c996
commit 89f6a499ed
4 changed files with 129 additions and 3 deletions

View File

@@ -3,4 +3,39 @@ package org.bukkit.entity;
/**
* Represents a Husk - variant of {@link Zombie}.
*/
public interface Husk extends Zombie { }
public interface Husk extends Zombie {
/**
* Get if this entity is in the process of converting to a Zombie as a
* result of being underwater.
*
* @return conversion status
*/
@Override
boolean isConverting();
/**
* Gets the amount of ticks until this entity will be converted to a Zombie
* as a result of being underwater.
*
* When this reaches 0, the entity will be converted.
*
* @return conversion time
* @throws IllegalStateException if {@link #isConverting()} is false.
*/
@Override
int getConversionTime();
/**
* Sets the amount of ticks until this entity will be converted to a Zombie
* as a result of being underwater.
*
* When this reaches 0, the entity will be converted. A value of less than 0
* will stop the current conversion process without converting the current
* entity.
*
* @param time new conversion time
*/
@Override
void setConversionTime(int time);
}