From 450f5fe793acf073c8f0832db74ccb01ae1a81bd Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Sun, 24 Oct 2021 20:29:27 -0700 Subject: [PATCH] Fix issues with mob conversion --- .../src/main/java/org/bukkit/entity/Hoglin.java | 14 +++++++++----- .../java/org/bukkit/entity/PiglinAbstract.java | 15 +++++++++------ 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/paper-api/src/main/java/org/bukkit/entity/Hoglin.java b/paper-api/src/main/java/org/bukkit/entity/Hoglin.java index 83a9e06fe9..452a8e73fa 100644 --- a/paper-api/src/main/java/org/bukkit/entity/Hoglin.java +++ b/paper-api/src/main/java/org/bukkit/entity/Hoglin.java @@ -44,13 +44,17 @@ public interface Hoglin extends Animals, Enemy { public int getConversionTime(); /** - * Sets the amount of ticks until this entity will be converted to a Zoglin. + * Sets the conversion counter value. The counter is incremented + * every tick the method {@link #isConverting()} returns true. Setting + * this value will not start the conversion if the {@link Hoglin} is + * not in a valid environment ({@link org.bukkit.World#isPiglinSafe}) + * to convert, is immune to zombification ({@link #isImmuneToZombification()}) + * or has no AI ({@link #hasAI}). * - * 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. + * When this reaches 300, the entity will be converted. To stop the + * conversion use {@link #setImmuneToZombification(boolean)}. * - * @param time new conversion time + * @param time new conversion counter */ public void setConversionTime(int time); diff --git a/paper-api/src/main/java/org/bukkit/entity/PiglinAbstract.java b/paper-api/src/main/java/org/bukkit/entity/PiglinAbstract.java index 9c4c1a4ab3..41aeb01f75 100644 --- a/paper-api/src/main/java/org/bukkit/entity/PiglinAbstract.java +++ b/paper-api/src/main/java/org/bukkit/entity/PiglinAbstract.java @@ -31,14 +31,17 @@ public interface PiglinAbstract extends Monster, Ageable { public int getConversionTime(); /** - * Sets the amount of ticks until this entity will be converted to a - * Zombified Piglin. + * Sets the conversion counter value. The counter is incremented + * every tick the method {@link #isConverting()} returns true. Setting + * this value will not start the conversion if the {@link PiglinAbstract} is + * not in a valid environment ({@link org.bukkit.World#isPiglinSafe}) + * to convert, is immune to zombification ({@link #isImmuneToZombification()}) + * or has no AI ({@link #hasAI}). * - * 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. + * When this reaches 300, the entity will be converted. To stop the + * conversion use {@link #setImmuneToZombification(boolean)}. * - * @param time new conversion time + * @param time new conversion counter */ public void setConversionTime(int time);