本文整理汇总了Java中net.minecraft.entity.ai.RandomPositionGenerator.findRandomTargetBlockTowards方法的典型用法代码示例。如果您正苦于以下问题:Java RandomPositionGenerator.findRandomTargetBlockTowards方法的具体用法?Java RandomPositionGenerator.findRandomTargetBlockTowards怎么用?Java RandomPositionGenerator.findRandomTargetBlockTowards使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.entity.ai.RandomPositionGenerator
的用法示例。
在下文中一共展示了RandomPositionGenerator.findRandomTargetBlockTowards方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: shouldExecute
import net.minecraft.entity.ai.RandomPositionGenerator; //导入方法依赖的package包/类
public boolean shouldExecute() {
if (!enabled) {
return false;
}
if (inCorrectPosition()) {
return false;
}
Vec3d vec3d = RandomPositionGenerator.findRandomTargetBlockTowards(this.entity, 16, 7, new Vec3d((double) centerX, (double) entity.posY, (double) centerZ));
if (vec3d == null) {
return false;
} else {
this.movePosX = vec3d.x;
this.movePosY = vec3d.y;
this.movePosZ = vec3d.z;
return true;
}
}
示例2: shouldExecute
import net.minecraft.entity.ai.RandomPositionGenerator; //导入方法依赖的package包/类
public boolean shouldExecute()
{
if (this.theEntity.isWithinHomeDistanceCurrentPosition())
{
return false;
}
else
{
ChunkCoordinates chunkcoordinates = this.theEntity.getHomePosition();
Vec3 vec3 = RandomPositionGenerator.findRandomTargetBlockTowards(this.theEntity, 16, 7, Vec3.createVectorHelper((double)chunkcoordinates.posX, (double)chunkcoordinates.posY, (double)chunkcoordinates.posZ));
if (vec3 == null)
{
return false;
}
else
{
this.movePosX = vec3.xCoord;
this.movePosY = vec3.yCoord;
this.movePosZ = vec3.zCoord;
return true;
}
}
}
开发者ID:Link1234Gamer,项目名称:FiveNightsAtFreddysUniverseMod,代码行数:25,代码来源:EntityBonnieAIMoveTowardsRestriction.java
示例3: shouldExecute
import net.minecraft.entity.ai.RandomPositionGenerator; //导入方法依赖的package包/类
/**
* Returns whether the EntityAIBase should begin execution.
*/
public boolean shouldExecute()
{
Herd myHerd = HerdCraft.herdCollectionObj.handleNearestHerdOrMakeNew(entity, entityEffectiveClass, minBreed, maxBreed, baseBreed, varBreed);
if (this.entity.getAITarget() != null)
{
myHerd.setEnemy(entity.getAITarget());
}
if (myHerd.getEnemy() == null)
{
return false;
}
Vec3 var1 = RandomPositionGenerator.findRandomTargetBlockTowards(this.entity, 15, 4, Vec3.createVectorHelper(entity.posX + myHerd.fleeIn.xCoord * 30.0d, entity.posY, entity.posZ + myHerd.fleeIn.zCoord * 30.0d));
if (var1 == null)
{
return false;
}
fleeX = var1.xCoord;
fleeY = var1.yCoord;
fleeZ = var1.zCoord;
return true;
}
示例4: circleTarget
import net.minecraft.entity.ai.RandomPositionGenerator; //导入方法依赖的package包/类
private void circleTarget() {
Vec3 entityPos = Vec3.createVectorHelper(entityHost.posX, entityHost.posY, entityHost.posZ);
Vec3 targetPos = Vec3.createVectorHelper(attackTarget.posX, attackTarget.posY, attackTarget.posZ);
Vec3 centerPos = targetPos.subtract(entityPos);
centerPos.rotateAroundY(clockwise?cautionAngle:-cautionAngle);
targetPos = centerPos.addVector(targetPos.xCoord, targetPos.yCoord, targetPos.zCoord);
entityPos = RandomPositionGenerator.findRandomTargetBlockTowards((EntityCreature) entityHost, 4, 4, targetPos);
if(entityPos != null)
{
entityHost.getNavigator().tryMoveToXYZ(entityPos.xCoord, entityPos.yCoord, entityPos.zCoord, entityMoveSpeed);
}
}
示例5: shouldExecute
import net.minecraft.entity.ai.RandomPositionGenerator; //导入方法依赖的package包/类
/**
* Returns whether the EntityAIBase should begin execution.
*/
public boolean shouldExecute()
{
if (this.entity.getAge() >= 100)
{
return false;
}
Herd nearHerd = HerdCraft.herdCollectionObj.handleNearestHerdOrMakeNew(entity, entityEffectiveClass, minBreed, maxBreed, baseBreed, varBreed);
ChunkCoordinates center = nearHerd.getCenter();
if (center.getDistanceSquared((int)entity.posX, (int)entity.posY, (int)entity.posZ) < (nearHerd.getHerdRadius() / 3) * (nearHerd.getHerdRadius() / 3)){
return false;
}
if (this.entity.getRNG().nextInt(20) != 0){
return false;
}
Vec3 var1 = RandomPositionGenerator.findRandomTargetBlockTowards(this.entity, 10, 4, Vec3.createVectorHelper(center.posX, center.posY, center.posZ));
if (var1 == null)
{
return false;
}
xPosition = var1.xCoord;
yPosition = var1.yCoord;
zPosition = var1.zCoord;
return true;
}
示例6: setNavigator
import net.minecraft.entity.ai.RandomPositionGenerator; //导入方法依赖的package包/类
public void setNavigator(int x, int y, int z){
this.workingState = false;
if (this.entity.getDistanceSq(x, y, z) > 256.0D){
Vec3 vec3 = RandomPositionGenerator.findRandomTargetBlockTowards(this.entity, 14, 3, this.entity.worldObj.getWorldVec3Pool().getVecFromPool(x, y, z));
if (vec3 != null){
this.entity.getNavigator().tryMoveToXYZ(vec3.xCoord, vec3.yCoord, vec3.zCoord, 0.8D);
}
} else{
this.entity.getNavigator().tryMoveToXYZ(x, y, z, 0.7D);
}
}