diff --git a/nms-patches/EntityAnimal.patch b/nms-patches/EntityAnimal.patch index 55cac48279..fda6865da8 100644 --- a/nms-patches/EntityAnimal.patch +++ b/nms-patches/EntityAnimal.patch @@ -1,8 +1,11 @@ --- a/net/minecraft/server/EntityAnimal.java +++ b/net/minecraft/server/EntityAnimal.java -@@ -8,6 +8,7 @@ +@@ -6,8 +6,9 @@ + public abstract class EntityAnimal extends EntityAgeable implements IAnimal { + protected Block bF; - private int bC; +- private int bC; ++ public int bC; // CraftBukkit - private -> public public UUID breedCause; + public ItemStack breedItem; // CraftBukkit - Add breedItem variable diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftAnimals.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftAnimals.java index 2478b934b7..b06909c3e9 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftAnimals.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftAnimals.java @@ -1,6 +1,7 @@ package org.bukkit.craftbukkit.entity; import java.util.UUID; +import com.google.common.base.Preconditions; import net.minecraft.server.EntityAnimal; import org.bukkit.craftbukkit.CraftServer; import org.bukkit.entity.Animals; @@ -30,4 +31,20 @@ public class CraftAnimals extends CraftAgeable implements Animals { public void setBreedCause(UUID uuid) { getHandle().breedCause = uuid; } + + @Override + public boolean isLoveMode() { + return getHandle().isInLove(); + } + + @Override + public void setLoveModeTicks(int ticks) { + Preconditions.checkArgument(ticks >= 0, "Love mode ticks must be positive or 0"); + getHandle().d(ticks); // PAIL rename setLoveModeTicks + } + + @Override + public int getLoveModeTicks() { + return getHandle().bC; // PAIL rename loveTicks + } }