本文整理汇总了Java中net.minecraft.entity.monster.EntityGuardian.getTargetedEntity方法的典型用法代码示例。如果您正苦于以下问题:Java EntityGuardian.getTargetedEntity方法的具体用法?Java EntityGuardian.getTargetedEntity怎么用?Java EntityGuardian.getTargetedEntity使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.entity.monster.EntityGuardian
的用法示例。
在下文中一共展示了EntityGuardian.getTargetedEntity方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: shouldRender
import net.minecraft.entity.monster.EntityGuardian; //导入方法依赖的package包/类
public boolean shouldRender(EntityGuardian livingEntity, ICamera camera, double camX, double camY, double camZ)
{
if (super.shouldRender(livingEntity, camera, camX, camY, camZ))
{
return true;
}
else
{
if (livingEntity.hasTargetedEntity())
{
EntityLivingBase entitylivingbase = livingEntity.getTargetedEntity();
if (entitylivingbase != null)
{
Vec3 vec3 = this.func_177110_a(entitylivingbase, (double)entitylivingbase.height * 0.5D, 1.0F);
Vec3 vec31 = this.func_177110_a(livingEntity, (double)livingEntity.getEyeHeight(), 1.0F);
if (camera.isBoundingBoxInFrustum(AxisAlignedBB.fromBounds(vec31.xCoord, vec31.yCoord, vec31.zCoord, vec3.xCoord, vec3.yCoord, vec3.zCoord)))
{
return true;
}
}
}
return false;
}
}
示例2: shouldRender
import net.minecraft.entity.monster.EntityGuardian; //导入方法依赖的package包/类
public boolean shouldRender(EntityGuardian livingEntity, ICamera camera, double camX, double camY, double camZ)
{
if (super.shouldRender((EntityLiving)livingEntity, camera, camX, camY, camZ))
{
return true;
}
else
{
if (livingEntity.hasTargetedEntity())
{
EntityLivingBase entitylivingbase = livingEntity.getTargetedEntity();
if (entitylivingbase != null)
{
Vec3 vec3 = this.func_177110_a(entitylivingbase, (double)entitylivingbase.height * 0.5D, 1.0F);
Vec3 vec31 = this.func_177110_a(livingEntity, (double)livingEntity.getEyeHeight(), 1.0F);
if (camera.isBoundingBoxInFrustum(AxisAlignedBB.fromBounds(vec31.xCoord, vec31.yCoord, vec31.zCoord, vec3.xCoord, vec3.yCoord, vec3.zCoord)))
{
return true;
}
}
}
return false;
}
}
示例3: shouldRender
import net.minecraft.entity.monster.EntityGuardian; //导入方法依赖的package包/类
public boolean shouldRender(EntityGuardian livingEntity, ICamera camera, double camX, double camY, double camZ)
{
if (super.shouldRender(livingEntity, camera, camX, camY, camZ))
{
return true;
}
else
{
if (livingEntity.hasTargetedEntity())
{
EntityLivingBase entitylivingbase = livingEntity.getTargetedEntity();
if (entitylivingbase != null)
{
Vec3d vec3d = this.getPosition(entitylivingbase, (double)entitylivingbase.height * 0.5D, 1.0F);
Vec3d vec3d1 = this.getPosition(livingEntity, (double)livingEntity.getEyeHeight(), 1.0F);
if (camera.isBoundingBoxInFrustum(new AxisAlignedBB(vec3d1.xCoord, vec3d1.yCoord, vec3d1.zCoord, vec3d.xCoord, vec3d.yCoord, vec3d.zCoord)))
{
return true;
}
}
}
return false;
}
}
示例4: setRotationAngles
import net.minecraft.entity.monster.EntityGuardian; //导入方法依赖的package包/类
/**
* Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
* and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
* "far" arms and legs can swing at most.
*/
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
{
EntityGuardian entityguardian = (EntityGuardian)entityIn;
float f = ageInTicks - (float)entityguardian.ticksExisted;
this.guardianBody.rotateAngleY = netHeadYaw * 0.017453292F;
this.guardianBody.rotateAngleX = headPitch * 0.017453292F;
float[] afloat = new float[] {1.75F, 0.25F, 0.0F, 0.0F, 0.5F, 0.5F, 0.5F, 0.5F, 1.25F, 0.75F, 0.0F, 0.0F};
float[] afloat1 = new float[] {0.0F, 0.0F, 0.0F, 0.0F, 0.25F, 1.75F, 1.25F, 0.75F, 0.0F, 0.0F, 0.0F, 0.0F};
float[] afloat2 = new float[] {0.0F, 0.0F, 0.25F, 1.75F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.75F, 1.25F};
float[] afloat3 = new float[] {0.0F, 0.0F, 8.0F, -8.0F, -8.0F, 8.0F, 8.0F, -8.0F, 0.0F, 0.0F, 8.0F, -8.0F};
float[] afloat4 = new float[] { -8.0F, -8.0F, -8.0F, -8.0F, 0.0F, 0.0F, 0.0F, 0.0F, 8.0F, 8.0F, 8.0F, 8.0F};
float[] afloat5 = new float[] {8.0F, -8.0F, 0.0F, 0.0F, -8.0F, -8.0F, 8.0F, 8.0F, 8.0F, -8.0F, 0.0F, 0.0F};
float f1 = (1.0F - entityguardian.getSpikesAnimation(f)) * 0.55F;
for (int i = 0; i < 12; ++i)
{
this.guardianSpines[i].rotateAngleX = (float)Math.PI * afloat[i];
this.guardianSpines[i].rotateAngleY = (float)Math.PI * afloat1[i];
this.guardianSpines[i].rotateAngleZ = (float)Math.PI * afloat2[i];
this.guardianSpines[i].rotationPointX = afloat3[i] * (1.0F + MathHelper.cos(ageInTicks * 1.5F + (float)i) * 0.01F - f1);
this.guardianSpines[i].rotationPointY = 16.0F + afloat4[i] * (1.0F + MathHelper.cos(ageInTicks * 1.5F + (float)i) * 0.01F - f1);
this.guardianSpines[i].rotationPointZ = afloat5[i] * (1.0F + MathHelper.cos(ageInTicks * 1.5F + (float)i) * 0.01F - f1);
}
this.guardianEye.rotationPointZ = -8.25F;
Entity entity = Minecraft.getMinecraft().getRenderViewEntity();
if (entityguardian.hasTargetedEntity())
{
entity = entityguardian.getTargetedEntity();
}
if (entity != null)
{
Vec3d vec3d = entity.getPositionEyes(0.0F);
Vec3d vec3d1 = entityIn.getPositionEyes(0.0F);
double d0 = vec3d.yCoord - vec3d1.yCoord;
if (d0 > 0.0D)
{
this.guardianEye.rotationPointY = 0.0F;
}
else
{
this.guardianEye.rotationPointY = 1.0F;
}
Vec3d vec3d2 = entityIn.getLook(0.0F);
vec3d2 = new Vec3d(vec3d2.xCoord, 0.0D, vec3d2.zCoord);
Vec3d vec3d3 = (new Vec3d(vec3d1.xCoord - vec3d.xCoord, 0.0D, vec3d1.zCoord - vec3d.zCoord)).normalize().rotateYaw(((float)Math.PI / 2F));
double d1 = vec3d2.dotProduct(vec3d3);
this.guardianEye.rotationPointX = MathHelper.sqrt_float((float)Math.abs(d1)) * 2.0F * (float)Math.signum(d1);
}
this.guardianEye.showModel = true;
float f2 = entityguardian.getTailAnimation(f);
this.guardianTail[0].rotateAngleY = MathHelper.sin(f2) * (float)Math.PI * 0.05F;
this.guardianTail[1].rotateAngleY = MathHelper.sin(f2) * (float)Math.PI * 0.1F;
this.guardianTail[1].rotationPointX = -1.5F;
this.guardianTail[1].rotationPointY = 0.5F;
this.guardianTail[1].rotationPointZ = 14.0F;
this.guardianTail[2].rotateAngleY = MathHelper.sin(f2) * (float)Math.PI * 0.15F;
this.guardianTail[2].rotationPointX = 0.5F;
this.guardianTail[2].rotationPointY = 0.5F;
this.guardianTail[2].rotationPointZ = 6.0F;
}