Java源码示例:net.minecraft.util.Vec3i

示例1
public void setPosition(RenderChunk rc, BlockPos bp) {
    if (!ChunkAnimatorConfig.enabled) return;
    if (Minecraft.getMinecraft().thePlayer != null) {
        boolean flag = true;
        BlockPos zeroedPlayerPosition = Minecraft.getMinecraft().thePlayer.getPosition();
        zeroedPlayerPosition = zeroedPlayerPosition.add(0, -zeroedPlayerPosition.getY(), 0);
        BlockPos zeroedCenteredChunkPos = bp.add(8, -bp.getY(), 8);

        if (ChunkAnimatorConfig.disableAroundPlayer) {
            flag = zeroedPlayerPosition.distanceSq(zeroedCenteredChunkPos) > (64 * 64);
        }

        if (flag) {
            EnumFacing chunkFacing = null;

            if (ChunkAnimatorConfig.mode.equals("From sides")) {
                Vec3i dif = zeroedPlayerPosition.subtract(zeroedCenteredChunkPos);
                int difX = Math.abs(dif.getX());
                int difZ = Math.abs(dif.getZ());
                chunkFacing = getFacing(dif, difX, difZ);
            }

            AnimationData animationData = new AnimationData(-1L, chunkFacing);
            timeStamps.put(rc, animationData);
        }
    }
}
 
示例2
public WrapperVec3i(Vec3i var1) {
    this.real = var1;
}
 
示例3
public Vec3i unwrap() {
    return this.real;
}
 
示例4
public WrapperVec3i getNULL_VECTOR() {
    return new WrapperVec3i(Vec3i.NULL_VECTOR);
}
 
示例5
@NotNull
private EnumFacing getFacing(Vec3i dif, int difX, int difZ) {
    return difX > difZ ? dif.getX() > 0 ? EnumFacing.EAST : EnumFacing.WEST : dif.getZ() > 0 ? EnumFacing.SOUTH : EnumFacing.NORTH;
}
 
示例6
@Override
public Vector3D toNova(BlockPos pos) {
	return toNova((Vec3i) pos);
}
 
示例7
public Vector3D toNova(Vec3i pos) {
	return new Vector3D(pos.getX(), pos.getY(), pos.getZ());
}