本文整理匯總了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);
}
}
}
}