当前位置: 首页>>代码示例>>Java>>正文


Java Village.findNearestDoorUnrestricted方法代码示例

本文整理汇总了Java中net.minecraft.village.Village.findNearestDoorUnrestricted方法的典型用法代码示例。如果您正苦于以下问题:Java Village.findNearestDoorUnrestricted方法的具体用法?Java Village.findNearestDoorUnrestricted怎么用?Java Village.findNearestDoorUnrestricted使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.village.Village的用法示例。


在下文中一共展示了Village.findNearestDoorUnrestricted方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: shouldExecute

import net.minecraft.village.Village; //导入方法依赖的package包/类
/**
 * Returns whether the EntityAIBase should begin execution.
 */
public boolean shouldExecute()
{
    int var1 = MathHelper.floor_double(this.entityObj.posX);
    int var2 = MathHelper.floor_double(this.entityObj.posY);
    int var3 = MathHelper.floor_double(this.entityObj.posZ);

    if ((!this.entityObj.worldObj.isDaytime() || this.entityObj.worldObj.isRaining() || !this.entityObj.worldObj.getBiomeGenForCoords(var1, var3).canSpawnLightningBolt()) && !this.entityObj.worldObj.provider.hasNoSky)
    {
        if (this.entityObj.getRNG().nextInt(50) != 0)
        {
            return false;
        }
        else if (this.insidePosX != -1 && this.entityObj.getDistanceSq((double)this.insidePosX, this.entityObj.posY, (double)this.insidePosZ) < 4.0D)
        {
            return false;
        }
        else
        {
            Village var4 = this.entityObj.worldObj.villageCollectionObj.findNearestVillage(var1, var2, var3, 14);

            if (var4 == null)
            {
                return false;
            }
            else
            {
                this.doorInfo = var4.findNearestDoorUnrestricted(var1, var2, var3);
                return this.doorInfo != null;
            }
        }
    }
    else
    {
        return false;
    }
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:40,代码来源:EntityAIMoveIndoors.java

示例2: shouldExecute

import net.minecraft.village.Village; //导入方法依赖的package包/类
public boolean shouldExecute()
{
    int i = MathHelper.floor_double(this.entityObj.posX);
    int j = MathHelper.floor_double(this.entityObj.posY);
    int k = MathHelper.floor_double(this.entityObj.posZ);

    if ((!this.entityObj.worldObj.isDaytime() || this.entityObj.worldObj.isRaining() || !this.entityObj.worldObj.getBiomeGenForCoords(i, k).canSpawnLightningBolt()) && !this.entityObj.worldObj.provider.hasNoSky)
    {
        if (this.entityObj.getRNG().nextInt(50) != 0)
        {
            return false;
        }
        else if (this.insidePosX != -1 && this.entityObj.getDistanceSq((double)this.insidePosX, this.entityObj.posY, (double)this.insidePosZ) < 4.0D)
        {
            return false;
        }
        else
        {
            Village village = this.entityObj.worldObj.villageCollectionObj.findNearestVillage(i, j, k, 14);

            if (village == null)
            {
                return false;
            }
            else
            {
                this.doorInfo = village.findNearestDoorUnrestricted(i, j, k);
                return this.doorInfo != null;
            }
        }
    }
    else
    {
        return false;
    }
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:37,代码来源:EntityAIMoveIndoors.java

示例3: shouldExecute

import net.minecraft.village.Village; //导入方法依赖的package包/类
/**
 * Returns whether the EntityAIBase should begin execution.
 */
public boolean shouldExecute()
{
    if ((!this.entityObj.worldObj.isDaytime() || this.entityObj.worldObj.isRaining()) && !this.entityObj.worldObj.provider.hasNoSky)
    {
        if (this.entityObj.getRNG().nextInt(50) != 0)
        {
            return false;
        }
        else if (this.insidePosX != -1 && this.entityObj.getDistanceSq((double)this.insidePosX, this.entityObj.posY, (double)this.insidePosZ) < 4.0D)
        {
            return false;
        }
        else
        {
            Village village = this.entityObj.worldObj.villageCollectionObj.findNearestVillage(MathHelper.floor_double(this.entityObj.posX), MathHelper.floor_double(this.entityObj.posY), MathHelper.floor_double(this.entityObj.posZ), 14);

            if (village == null)
            {
                return false;
            }
            else
            {
                this.doorInfo = village.findNearestDoorUnrestricted(MathHelper.floor_double(this.entityObj.posX), MathHelper.floor_double(this.entityObj.posY), MathHelper.floor_double(this.entityObj.posZ));
                return this.doorInfo != null;
            }
        }
    }
    else
    {
        return false;
    }
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:36,代码来源:EntityAIMoveIndoors.java


注:本文中的net.minecraft.village.Village.findNearestDoorUnrestricted方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。