本文整理汇总了Java中net.minecraft.entity.monster.EntityShulker.getAttachmentPos方法的典型用法代码示例。如果您正苦于以下问题:Java EntityShulker.getAttachmentPos方法的具体用法?Java EntityShulker.getAttachmentPos怎么用?Java EntityShulker.getAttachmentPos使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.entity.monster.EntityShulker
的用法示例。
在下文中一共展示了EntityShulker.getAttachmentPos方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doRender
import net.minecraft.entity.monster.EntityShulker; //导入方法依赖的package包/类
/**
* Renders the desired {@code T} type Entity.
*/
public void doRender(EntityShulker entity, double x, double y, double z, float entityYaw, float partialTicks)
{
int i = entity.getClientTeleportInterp();
if (i > 0 && entity.isAttachedToBlock())
{
BlockPos blockpos = entity.getAttachmentPos();
BlockPos blockpos1 = entity.getOldAttachPos();
double d0 = (double)((float)i - partialTicks) / 6.0D;
d0 = d0 * d0;
double d1 = (double)(blockpos.getX() - blockpos1.getX()) * d0;
double d2 = (double)(blockpos.getY() - blockpos1.getY()) * d0;
double d3 = (double)(blockpos.getZ() - blockpos1.getZ()) * d0;
super.doRender(entity, x - d1, y - d2, z - d3, entityYaw, partialTicks);
}
else
{
super.doRender(entity, x, y, z, entityYaw, partialTicks);
}
}
示例2: shouldRender
import net.minecraft.entity.monster.EntityShulker; //导入方法依赖的package包/类
public boolean shouldRender(EntityShulker livingEntity, ICamera camera, double camX, double camY, double camZ)
{
if (super.shouldRender(livingEntity, camera, camX, camY, camZ))
{
return true;
}
else
{
if (livingEntity.getClientTeleportInterp() > 0 && livingEntity.isAttachedToBlock())
{
BlockPos blockpos = livingEntity.getOldAttachPos();
BlockPos blockpos1 = livingEntity.getAttachmentPos();
Vec3d vec3d = new Vec3d((double)blockpos1.getX(), (double)blockpos1.getY(), (double)blockpos1.getZ());
Vec3d vec3d1 = new Vec3d((double)blockpos.getX(), (double)blockpos.getY(), (double)blockpos.getZ());
if (camera.isBoundingBoxInFrustum(new AxisAlignedBB(vec3d1.xCoord, vec3d1.yCoord, vec3d1.zCoord, vec3d.xCoord, vec3d.yCoord, vec3d.zCoord)))
{
return true;
}
}
return false;
}
}
示例3: doRender
import net.minecraft.entity.monster.EntityShulker; //导入方法依赖的package包/类
/**
* Renders the desired {@code T} type Entity.
*/
public void doRender(EntityShulker entity, double x, double y, double z, float entityYaw, float partialTicks)
{
if (this.modelVersion != ((ModelShulker)this.mainModel).getModelVersion())
{
this.mainModel = new ModelShulker();
this.modelVersion = ((ModelShulker)this.mainModel).getModelVersion();
}
int i = entity.getClientTeleportInterp();
if (i > 0 && entity.isAttachedToBlock())
{
BlockPos blockpos = entity.getAttachmentPos();
BlockPos blockpos1 = entity.getOldAttachPos();
double d0 = (double)((float)i - partialTicks) / 6.0D;
d0 = d0 * d0;
double d1 = (double)(blockpos.getX() - blockpos1.getX()) * d0;
double d2 = (double)(blockpos.getY() - blockpos1.getY()) * d0;
double d3 = (double)(blockpos.getZ() - blockpos1.getZ()) * d0;
super.doRender(entity, x - d1, y - d2, z - d3, entityYaw, partialTicks);
}
else
{
super.doRender(entity, x, y, z, entityYaw, partialTicks);
}
}