/**
* Checks to make sure the light is not too bright where the mob is spawning
*/
protected boolean isValidLightLevel()
{
BlockPos blockpos = new BlockPos(this.posX, this.getEntityBoundingBox().minY, this.posZ);
if (this.worldObj.getLightFor(EnumSkyBlock.SKY, blockpos) > this.rand.nextInt(32))
{
return false;
}
else
{
int i = this.worldObj.getLightFromNeighbors(blockpos);
if (this.worldObj.isThundering())
{
int j = this.worldObj.getSkylightSubtracted();
this.worldObj.setSkylightSubtracted(10);
i = this.worldObj.getLightFromNeighbors(blockpos);
this.worldObj.setSkylightSubtracted(j);
}
return i <= this.rand.nextInt(8);
}
}
EntityMob.java 文件源码
java
阅读 30
收藏 0
点赞 0
评论 0
项目:BaseClient
作者:
评论列表
文章目录