AnimalFarmEntity.java 文件源码

java
阅读 16 收藏 0 点赞 0 评论 0

项目:Mekfarm 作者:
static ItemStack packageAnimal(ItemStack packageStack, EntityAnimal animal) {
    ItemStack stackCopy = (packageStack == null) ? new ItemStack(ItemsRegistry.animalPackage) : packageStack.copy();

    stackCopy.setTagInfo("hasAnimal", new NBTTagInt(1));
    NBTTagCompound animalCompound = new NBTTagCompound();
    animal.writeEntityToNBT(animalCompound);
    stackCopy.setTagInfo("animal", animalCompound);
    stackCopy.setTagInfo("animalClass", new NBTTagString(animal.getClass().getName()));
    stackCopy.setTagInfo("animalHealth", new NBTTagFloat(animal.getHealth()));
    return stackCopy;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号