mirror of
https://github.com/PaperMC/Paper.git
synced 2025-03-12 06:43:58 +01:00
#856: Add methods to check if item is the breed item for an entity
By: Nathat23 <nathat890@outlook.com>
This commit is contained in:
parent
472f590189
commit
94c0260719
@ -3,8 +3,11 @@ package org.bukkit.craftbukkit.entity;
|
||||
import com.google.common.base.Preconditions;
|
||||
import java.util.UUID;
|
||||
import net.minecraft.world.entity.animal.EntityAnimal;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.craftbukkit.CraftServer;
|
||||
import org.bukkit.craftbukkit.inventory.CraftItemStack;
|
||||
import org.bukkit.entity.Animals;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
public class CraftAnimals extends CraftAgeable implements Animals {
|
||||
|
||||
@ -47,4 +50,14 @@ public class CraftAnimals extends CraftAgeable implements Animals {
|
||||
public int getLoveModeTicks() {
|
||||
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…
Reference in New Issue
Block a user