本文整理汇总了Java中net.minecraft.entity.Entity.getMirroredYaw方法的典型用法代码示例。如果您正苦于以下问题:Java Entity.getMirroredYaw方法的具体用法?Java Entity.getMirroredYaw怎么用?Java Entity.getMirroredYaw使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.entity.Entity
的用法示例。
在下文中一共展示了Entity.getMirroredYaw方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addEntitiesToWorld
import net.minecraft.entity.Entity; //导入方法依赖的package包/类
private void addEntitiesToWorld(World worldIn, BlockPos pos, Mirror mirrorIn, Rotation rotationIn, @Nullable StructureBoundingBox aabb)
{
for (Template.EntityInfo template$entityinfo : this.entities)
{
BlockPos blockpos = transformedBlockPos(template$entityinfo.blockPos, mirrorIn, rotationIn).add(pos);
if (aabb == null || aabb.isVecInside(blockpos))
{
NBTTagCompound nbttagcompound = template$entityinfo.entityData;
Vec3d vec3d = transformedVec3d(template$entityinfo.pos, mirrorIn, rotationIn);
Vec3d vec3d1 = vec3d.addVector((double)pos.getX(), (double)pos.getY(), (double)pos.getZ());
NBTTagList nbttaglist = new NBTTagList();
nbttaglist.appendTag(new NBTTagDouble(vec3d1.x));
nbttaglist.appendTag(new NBTTagDouble(vec3d1.y));
nbttaglist.appendTag(new NBTTagDouble(vec3d1.z));
nbttagcompound.setTag("Pos", nbttaglist);
nbttagcompound.setUniqueId("UUID", UUID.randomUUID());
Entity entity;
try
{
entity = EntityList.createEntityFromNBT(nbttagcompound, worldIn);
}
catch (Exception var15)
{
entity = null;
}
if (entity != null)
{
float f = entity.getMirroredYaw(mirrorIn);
f = f + (entity.rotationYaw - entity.getRotatedYaw(rotationIn));
entity.setLocationAndAngles(vec3d1.x, vec3d1.y, vec3d1.z, f, entity.rotationPitch);
worldIn.spawnEntity(entity);
}
}
}
}
示例2: addEntitiesToWorld
import net.minecraft.entity.Entity; //导入方法依赖的package包/类
private void addEntitiesToWorld(World worldIn, BlockPos pos, Mirror mirrorIn, Rotation rotationIn, @Nullable StructureBoundingBox aabb)
{
for (Template.EntityInfo template$entityinfo : this.entities)
{
BlockPos blockpos = transformedBlockPos(template$entityinfo.blockPos, mirrorIn, rotationIn).add(pos);
if (aabb == null || aabb.isVecInside(blockpos))
{
NBTTagCompound nbttagcompound = template$entityinfo.entityData;
Vec3d vec3d = transformedVec3d(template$entityinfo.pos, mirrorIn, rotationIn);
Vec3d vec3d1 = vec3d.addVector((double)pos.getX(), (double)pos.getY(), (double)pos.getZ());
NBTTagList nbttaglist = new NBTTagList();
nbttaglist.appendTag(new NBTTagDouble(vec3d1.xCoord));
nbttaglist.appendTag(new NBTTagDouble(vec3d1.yCoord));
nbttaglist.appendTag(new NBTTagDouble(vec3d1.zCoord));
nbttagcompound.setTag("Pos", nbttaglist);
nbttagcompound.setUniqueId("UUID", UUID.randomUUID());
Entity entity;
try
{
entity = EntityList.createEntityFromNBT(nbttagcompound, worldIn);
}
catch (Exception var15)
{
entity = null;
}
if (entity != null)
{
float f = entity.getMirroredYaw(mirrorIn);
f = f + (entity.rotationYaw - entity.getRotatedYaw(rotationIn));
entity.setLocationAndAngles(vec3d1.xCoord, vec3d1.yCoord, vec3d1.zCoord, f, entity.rotationPitch);
worldIn.spawnEntityInWorld(entity);
}
}
}
}