SPIGOT-4526: Add conversion time API for Zombie & subclasses
By: md_5 <git@md-5.net>
This commit is contained in:
@@ -3,4 +3,39 @@ package org.bukkit.entity;
|
|||||||
/**
|
/**
|
||||||
* Represents a Husk - variant of {@link Zombie}.
|
* 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);
|
||||||
|
}
|
||||||
|
|||||||
@@ -33,4 +33,28 @@ public interface PigZombie extends Zombie {
|
|||||||
* @return True if the zombie is angry, otherwise false.
|
* @return True if the zombie is angry, otherwise false.
|
||||||
*/
|
*/
|
||||||
boolean isAngry();
|
boolean isAngry();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <b>Not applicable to this entity</b>
|
||||||
|
*
|
||||||
|
* @return false
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean isConverting();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <b>Not applicable to this entity</b>
|
||||||
|
*
|
||||||
|
* @return UnsuppotedOperationException
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int getConversionTime();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <b>Not applicable to this entity</b>
|
||||||
|
*
|
||||||
|
* @param time unused
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void setConversionTime(int time);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,4 +48,35 @@ public interface Zombie extends Monster {
|
|||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public Villager.Profession getVillagerProfession();
|
public Villager.Profession getVillagerProfession();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get if this entity is in the process of converting to a Drowned as a
|
||||||
|
* result of being underwater.
|
||||||
|
*
|
||||||
|
* @return conversion status
|
||||||
|
*/
|
||||||
|
boolean isConverting();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the amount of ticks until this entity will be converted to a Drowned
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
int getConversionTime();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the amount of ticks until this entity will be converted to a Drowned
|
||||||
|
* 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
|
||||||
|
*/
|
||||||
|
void setConversionTime(int time);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,12 +8,48 @@ public interface ZombieVillager extends Zombie {
|
|||||||
/**
|
/**
|
||||||
* Sets the villager profession of this zombie.
|
* Sets the villager profession of this zombie.
|
||||||
*/
|
*/
|
||||||
public void setVillagerProfession(Villager.Profession profession);
|
@Override
|
||||||
|
void setVillagerProfession(Villager.Profession profession);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the villager profession of this zombie.
|
* Returns the villager profession of this zombie.
|
||||||
*
|
*
|
||||||
* @return the profession or null
|
* @return the profession or null
|
||||||
*/
|
*/
|
||||||
public Villager.Profession getVillagerProfession();
|
@Override
|
||||||
|
Villager.Profession getVillagerProfession();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get if this entity is in the process of converting to a Villager as a
|
||||||
|
* result of being cured.
|
||||||
|
*
|
||||||
|
* @return conversion status
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
boolean isConverting();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the amount of ticks until this entity will be converted to a
|
||||||
|
* Villager as a result of being cured.
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* Villager as a result of being cured.
|
||||||
|
*
|
||||||
|
* 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);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user