#856: Add methods to check if item is the breed item for an entity
This commit is contained in:
parent
dd4bec5f13
commit
4ece3ff36d
@ -3,8 +3,11 @@ package org.bukkit.craftbukkit.entity;
|
|||||||
import com.google.common.base.Preconditions;
|
import com.google.common.base.Preconditions;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import net.minecraft.world.entity.animal.EntityAnimal;
|
import net.minecraft.world.entity.animal.EntityAnimal;
|
||||||
|
import org.bukkit.Material;
|
||||||
import org.bukkit.craftbukkit.CraftServer;
|
import org.bukkit.craftbukkit.CraftServer;
|
||||||
|
import org.bukkit.craftbukkit.inventory.CraftItemStack;
|
||||||
import org.bukkit.entity.Animals;
|
import org.bukkit.entity.Animals;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
public class CraftAnimals extends CraftAgeable implements Animals {
|
public class CraftAnimals extends CraftAgeable implements Animals {
|
||||||
|
|
||||||
@ -47,4 +50,14 @@ public class CraftAnimals extends CraftAgeable implements Animals {
|
|||||||
public int getLoveModeTicks() {
|
public int getLoveModeTicks() {
|
||||||
return getHandle().inLove;
|
return getHandle().inLove;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isBreedItem(ItemStack itemStack) {
|
||||||
|
return getHandle().n(CraftItemStack.asNMSCopy(itemStack));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isBreedItem(Material material) {
|
||||||
|
return isBreedItem(new ItemStack(material));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user