From e34cd0f4b976cd2067548040ed69b4e6482775dc Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Mon, 29 Jun 2020 09:58:07 +1000 Subject: [PATCH] SPIGOT-5803: Implement the missing methods for the Piglin API. By: ceezuns <49824660+ceezuns@users.noreply.github.com> --- .../main/java/org/bukkit/entity/Piglin.java | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/paper-api/src/main/java/org/bukkit/entity/Piglin.java b/paper-api/src/main/java/org/bukkit/entity/Piglin.java index 8dbbb427e..2347dc556 100644 --- a/paper-api/src/main/java/org/bukkit/entity/Piglin.java +++ b/paper-api/src/main/java/org/bukkit/entity/Piglin.java @@ -5,6 +5,64 @@ package org.bukkit.entity; */ public interface Piglin extends Monster { + /** + * Gets whether the piglin is immune to zombification. + * + * @return Whether the piglin is immune to zombification + */ + public boolean isImmuneToZombification(); + + /** + * Sets whether the piglin is immune to zombification. + * + * @param flag Whether the piglin is immune to zombification + */ + public void setImmuneToZombification(boolean flag); + + /** + * Get whether the piglin is able to hunt hoglins. + * + * @return Whether the piglin is able to hunt hoglins + */ + public boolean isAbleToHunt(); + + /** + * Sets whether the piglin is able to hunt hoglins. + * + * @param flag Whether the piglin is able to hunt hoglins. + */ + public void setIsAbleToHunt(boolean flag); + + /** + * Gets the amount of ticks until this entity will be converted to a + * Zombified Piglin. + * + * When this reaches 300, the entity will be converted. + * + * @return conversion time + * @throws IllegalStateException if {@link #isConverting()} is false. + */ + public int getConversionTime(); + + /** + * Sets the amount of ticks until this entity will be converted to a + * Zombified Piglin. + * + * 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 + */ + public void setConversionTime(int time); + + /** + * Get if this entity is in the process of converting to a Zombified Piglin. + * + * @return conversion status + */ + boolean isConverting(); + /** * Gets whether the piglin is a baby *