StructureVillagePieces.java 文件源码

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

项目:PopularMMOS-EpicProportions-Mod 作者:
/**
 * Spawns a number of villagers in this component. Parameters: world, component bounding box, x offset, y
 * offset, z offset, number of villagers
 */
protected void spawnVillagers(World p_74893_1_, StructureBoundingBox p_74893_2_, int p_74893_3_, int p_74893_4_, int p_74893_5_, int p_74893_6_)
{
    if (this.villagersSpawned < p_74893_6_)
    {
        for (int i1 = this.villagersSpawned; i1 < p_74893_6_; ++i1)
        {
            int j1 = this.getXWithOffset(p_74893_3_ + i1, p_74893_5_);
            int k1 = this.getYWithOffset(p_74893_4_);
            int l1 = this.getZWithOffset(p_74893_3_ + i1, p_74893_5_);

            if (!p_74893_2_.isVecInside(j1, k1, l1))
            {
                break;
            }

            ++this.villagersSpawned;
            EntityVillager entityvillager = new EntityVillager(p_74893_1_, this.getVillagerType(i1));
            entityvillager.setLocationAndAngles((double)j1 + 0.5D, (double)k1, (double)l1 + 0.5D, 0.0F, 0.0F);
            p_74893_1_.spawnEntityInWorld(entityvillager);
        }
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号