mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-22 17:07:34 +01:00
Add love mode API to Animals
This commit is contained in:
parent
40cbae42b1
commit
0f708cbf51
@ -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
|
||||
|
||||
|
@ -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
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user