Add love mode API to Animals
Dieser Commit ist enthalten in:
Ursprung
40cbae42b1
Commit
0f708cbf51
@ -1,8 +1,11 @@
|
|||||||
--- a/net/minecraft/server/EntityAnimal.java
|
--- a/net/minecraft/server/EntityAnimal.java
|
||||||
+++ b/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;
|
protected Block bF;
|
||||||
private int bC;
|
- private int bC;
|
||||||
|
+ public int bC; // CraftBukkit - private -> public
|
||||||
public UUID breedCause;
|
public UUID breedCause;
|
||||||
+ public ItemStack breedItem; // CraftBukkit - Add breedItem variable
|
+ public ItemStack breedItem; // CraftBukkit - Add breedItem variable
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package org.bukkit.craftbukkit.entity;
|
package org.bukkit.craftbukkit.entity;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
import com.google.common.base.Preconditions;
|
||||||
import net.minecraft.server.EntityAnimal;
|
import net.minecraft.server.EntityAnimal;
|
||||||
import org.bukkit.craftbukkit.CraftServer;
|
import org.bukkit.craftbukkit.CraftServer;
|
||||||
import org.bukkit.entity.Animals;
|
import org.bukkit.entity.Animals;
|
||||||
@ -30,4 +31,20 @@ public class CraftAnimals extends CraftAgeable implements Animals {
|
|||||||
public void setBreedCause(UUID uuid) {
|
public void setBreedCause(UUID uuid) {
|
||||||
getHandle().breedCause = 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
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren